I have am trying to debug some PHPunit tests in netbeans, but it doesn't stop at my break-points.
I can, however, debug the site in the browser and it stops at my breakpoints.
I have modified file->project properties->run configuration->advanced to "do not open web browser".
I use the following script to initiate phpunit :
export XDEBUG_CONFIG="idekey=netbeans-xdebug";
phpunit $#
What could be the problem?
ps. I have had it working in the past, but it stopped working and I had to reinstall xdebug. I am using ubuntu 11.10
Thanks.
This usually happens when your port is not set to listen on xdebug's default listener port 9000.
Here's some instructions on mac for netbeans but it should do the trick even if you're running windows.
http://netbeans.org/kb/docs/php/configure-php-environment-mac-os.html
Related
I am running Homestead on Windows 10 machine with Virtual Box. I have VSCode running on the Windows machine and I want to be able to debug code in the VM.
I have followed this setup:
https://tighten.co/blog/debugging-configure-xdebug-and-laravel-homestead-and-vs-code-and-phpunit
Once I am listening for Xdebug I run my code in the VM using phpunit test/Feature/AdminTest.php and this fails with
Unable to open 'BaseTestRunner.php': File not found
(file:///c:/g/Sites/Laravel/everyone-in-mind/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php).
Which is obviously showing me the Windows path.
If I stop the debugger and run again the test runs fine.
Do I need to install something extra to get BaseTestRunner?
When you are debuging a PHPUnittest with xDebug in VSCode with the PHPUnit plugin from Elon Mallin, check that you have disable the option Breakpoints/Everything.
It seems as if PHPUnittest, running from the PHPUnit-plugin, could not find the BaseTestRunner.php file and raised an exection. When you ignore this exception, you can run and debug your test.
see the same question PHpUnit with xdebug Breaks at BaseTestRunner instead of the actual test
It works for me and can now debug the Unittest.
When I do on my app.js Debug As > Node Application it says
Launching STANDALONE_V8 has encountered a problem.
Failed to connect to Standalone V8 VM
connect timed out
It should start an app. Doing so directly on my terminal works fine.
When I start a debug session in my terminal and than try to debug it in Eclipse works fine too.
So is there anything that has to be done in order to make it work in Eclipse?
What exact error is in ErrorLog View on in Nodeclipse Console?
What is Java is used and Nodeclipse version?
Try to specify Java version: in eclipse.ini point to JDK 7
Check also
- toggleBreakpointsTargetFactory specified id is already registered
Okay, I'm killing myself over this. I've been trying every single tutorial I can and still not luck. Aptana is just "waiting for XDebug Session".
I have XDebug setup on my remote server on port 9000.
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_mode="jit"
This all seems to be correct and phpinfo makes it look correct. Now I went into Aptana to set this up and all of the tutorials involve localhost in some way. Maybe I am severely overlooking a component of xdebug (can it only debug local?). There is no way currently to have my application run locally because I am running nontraditional stack items which I don't want to install just for this.
I have setup aptana php interpreter: http://grab.by/poMm
I have setup aptana remote server using my base url and the local file document root
I have chrome xdebug helper turned on using key ECLIPSE_DBGP
Aptana is still just waiting for XDebug session. Please help!
Here is the relevant part of my (working) php.ini:
zend_extension=/usr/local/zend/lib/php_extensions/xdebug.so
xdebug.remote_enable=on
xdebug.remote_log="/var/log/xdebug.log"
xdebug.remote_host=localhost
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
Note, there are several differences between your config and mine:
You enclose many of your vars with quotes
"On" should probably be "on" (without quotes)
there is no reference to auto_start or connnect_back
Try making those changes and see if that does it for you.
I recently upgraded from Eclipse Galileo to Helios. Helios stops at breakpoints ONLY when debugging "as a PHP Script", but not when debugging "as a Web Page".
When debugging as a web page, it looks like the correct debug query string to start a debug session is getting tacked on to the url, like so:
http://localhost/hello.php?XDEBUG_SESSION_START=ECLIPSE_DBGP &KEY=129798139020511
but elipse does not stop at the breakpoints. It just zooms thru the code and displays the output in the browser.
This is my xdebug configuration in php.ini that works for Galileo, but is not working for Helios: (click here to see my entire xdebug config settings)
;extension=xdebug.so <-- is this needed?
zend_extension=" /Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-no n-zts-20090626/xdebug.so "
xdebug.remote_enable=on
xdebug.remote_autostart=off
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.idekey=
; to enable remote debugging
zend_debugger.allow_hosts=127.0.0.1/32
zend_debugger.expose_remotely=always
Can you post your xdebug configuration that works for Helios? If possible, can you share the xdebug portion of your phpinfo() output? Would like to compare settings of an xdebug configuration that works on Helios with what I have.
I am having the exact same issue. I did find some bug reports about breakpoints in Galileo not being able to be used in Helios. I can get Helios to stop on breakpoints at times, but I have to delete all my breakpoints and then start debugging, and only after that add a breakpoint. Needless to say this is very annoying. I'll try and find the link that I saw and add it to here.
For now I've gone back to Galileo.
Malks.
I'm using:
Ubuntu 14.04 64 bits
Eclipse Luna
Nginx
PHP Fpm (via socket)
I solved this debugging problem disabling IPV6
Edit /etc/sysctl.conf and add the following lines:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
Then reboot or sudo sysctl -p
Here is my situation:
I am developing PHP CLI scripts on a distant server using Eclipse IDE with the RSE plugin (allows to edit files directly on the server).
Now I need to debug these scripts in a similar fashion than in Java (break points, show the variables content, ...).
I found something that could do the job: XDebug and PDT (Eclipse plugin). The problem is that when I try to launch the debug mode Eclipse says that there is no PHP debugger on the local machine. I guess it should be installed on the server machine.
I would like to know if it's possible to use PDT and XDebug to debug remote scripts and, if it's the case, how to configure them to do so. If not, I'd like to know if other solutions exist. It seems like XDebug uses TCP so it should be possible to debug remotely. I can change my IDE if necessary.
The server runs Ubuntu 10.04 with php5-cli and the dev machine with eclipse runs Win7 32bit.
Thanks
Yes this is possible, you need to enable xdebug in the remote server's PHP.ini file and make sure that the xdebug port (default 9000) is not blocked by any firewalls.
xdebug's page on setting up remote debugging.
Here is the complete procedure for the people who have the same problem:
First, install RSE by following the instructions on this website: http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.rse.doc.user/gettingstarted/g1installing.html
Follow the instructions on this HowTo to install XDebug on the server:
http://ubuntuforums.org/showthread.php?t=525257
Install PDT on Eclipse and do the following changes:
- under Windows/Preferences, go under PHP/Debug and change PHP Debugger to XDebug
- under Windows/Preferences, go under PHP/Debug/Installed Debuggers and configure XDebug. Change the field "Accept remote session (JIT)" to "any".
Open the Remote System Explorer perspective, select your scripts directories and create a project from them (Right Click, Create Remote Project). It will now appear in the PHP perspective.
Let Eclipse run and go to the server (e.g. via SSH). Run the script you want to debug. A Window will then appear on Eclipse proposing you to choose with which "local" (remote via RSE in our case) file you want to link the running script to. Normally, the default script proposed should be the correct one, because it is the one running on the server.
You should now have visual debugging with Eclipse for your PHP-CLI scripts!
Do you want to debug while being able to interact with the script on CLI or do you just want to start it and then step through the code? I guess your question is referring to the problem that you can't access the script directly through a URL. If that's your problem, then I guess the easiest solution would be to debug a usual PHP-web-site which requires your script. Then you can launch XDebug with that web-site initially and step into the script through the require/include-statement.
index.php:
<?php require_once("../../../../../dir1/[...]/cliscript.php");
Best regards
Raffael