Reputation: 361
I have xdebug running but it doesn't matter where I put my break point it never stops.
php.ini
[xdebug]
zend_extension_ts = c:\wamp\bin\php\php5.2.8\ext\php_xdebug-2.1.2-5.2-vc6.dll
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=Chris-Pc
xdebug.remote_port=9000
Upvotes: 11
Views: 16836
Reputation: 16494
I asked the same thing and got this quite good answer: How to track execution time of each line / block of lines / methods in PHP?.
Some additional notes on that (stuff i've collected in other SO posts in my own research with this problem):
Upvotes: 5
Reputation: 75
Please check this. In your php.ini make sure all this options are enabled. Otherwise add it in the end of your php.ini file (for example /etc/php/5.6/apache2/php.ini ).
[xdebug]
zend_extension="/usr/lib/php5/20121212/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.default_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey="netbeans-xdebug"
Check the path(/usr/lib/php5/20121212/) for xdebug.so in your file system accordingly change zend_extension value.
1st line zend_extension value is here for ubuntu users. I think that variable no need to change. Please uncheck the stop at First line(tools->options->php->Debugging).
Upvotes: 2
Reputation: 111
One more tip that's not mentioned here: make sure that you have your web root directory set correctly.
Go to File -> Project properties -> Sources -> Web root -> Browse and select your actual web root directory.
My configuration is Kubuntu 15.04, PhP 5.5 and I'm developing CakePhP application and I had to set my webroot directory to /app/webroot [or /app/View/Theme/webroot in case you're using themes]. Without this setting, xdebug was ignoring breakpoints, although otherwise working (and actually stopping on the first line of the index.php file).
Upvotes: 9
Reputation: 1142
There are several things you can try:
Upvotes: 4
Reputation: 380
Is port 9000 available for usage, try changing it to 9001 (both Netbeans and php.ini). I would first try to breakpoint with xdebug_break() and see what is shown in "Variables" window. At least superglobals must be shown.
Btw: breakpoints with IDE (left side: line numbers) cannot be created on a blank line or line with comments, it has to contain some code.
Upvotes: 0
Reputation: 99
I had a similar issue and came across a post to fix the problem. My html form (testform.html) was calling a php script (runQuery.php) and Netbeans could not break at the set break points in my runQuery.php
After checking all the configuration settings in php.ini and Netbeans by searching on forums like this one, I discovered that netbeans will only break on the break points if the Index file for the project is a PHP file. This is very important otherwise you will spend hours trying to figure out why break points are not working.
In Netbeans go into the File/Project Properties/Run Configuration and check that the Index file is a PHP file. In my case I changed my index file from testform.html to testform.php and it worked, I was able to break on break points.
Yasar
Upvotes: 4
Reputation: 263
Make sure that your netbeans setting as follow:
Tool->option dialog box will open now click on PHP there are number of tabs click on Debugging and check the debugger port is 9000
Upvotes: 2
Reputation: 306
Best is to tunnel through SSH, setting your remote host to localhost. It will prevent you from getting messed ip with firewalls, nat or port forwarding.
Upvotes: 1