Reputation: 21156
I would like to turn on the debugger, I imagined that either:
I have been changing various bits and bobs trying to get the debugger to work in NetBeans All of which seems to have been in the php.ini file:
zend_extension = "c:/wamp/bin/php/php5.4.16/zend_ext/php_xdebug-2.2.3-5.4-vc9.dll"
[xdebug]
xdebug.remote_enable = off
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
I really do not understand what the above is doing but I've been following tutorial after tutorial and getting no where.
What ends up happening is that I press the run button in Netbeans, the debugger part keeps saying connecting, while my browser has already loaded the page and presented everything, ignoring the fact I wanted to break at a point.
Any ideas?
Upvotes: 0
Views: 441
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.
Upvotes: 0
Reputation: 541
When you install netbeans it automatically adds these lines to your PHP.ini file (C:\wamp\bin\apache{your-version-of-apache}\bin\php.ini), as James has described.
To fix the issue of netbeans saying "waiting for connection to netbeans-xdebug" follow the few steps bellow.
Remove the lChange the following lines in the php.ini file to
zend_extension = "c:/wamp/bin/php/php5.4.16/zend_ext/php_xdebug-2.2.3-5.4-vc9.dll"
[xdebug]
xdebug.remote_enable = 1
xdebud.idekey="netbeans-xdebug"
xdebug.profiler_enable = 1
In netbeans click tools > Options > php > debugging
Make sure the debugger port is 9000 and session id is netbeans-xdebug
Upvotes: 1