Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug PHP test files in Netbeans

When I Right Click > Debug File, the test runs successfully, but Netbeans can connect to xdebug. I can confirm that debugging works in the normal Debug Project.

Is it even possible to debug a test file? If no, are there any alternatives? Thanks!

like image 465
Dalton Tan Avatar asked Jul 31 '11 14:07

Dalton Tan


2 Answers

If you need to debug a separate file then you need to choose Debug File (shortcut CTRL + SHIFT + F5) instead of Debug Main Project (shortcut CTRL + F5).

like image 168
brezanac Avatar answered Sep 28 '22 02:09

brezanac


I copied the xdebug settings from my apache2/php.ini file to my cli/php.ini (Command Line Interface).

The file path on ubuntu 10.04 installed with apt-get is /etc/php5/cli/php.ini.

My cli/php.ini file now has these settings:

xdebug.remote_enable=On
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=netbeans-xdebug
xdebug.remote_mode=req

Then I can right click on the test file and select Debug (shortcut is CTRL + SHIFT + F5)

like image 25
Steven Wexler Avatar answered Sep 28 '22 02:09

Steven Wexler