Ubuntu, PHP, NetBeans - part III
By Petr on Jul 16, 2008
In the first part we enabled the debugging PHP scripts under Apache. But when you want to debug a PHP script, which is running in command line, then you have to enabled it in /etc/php5/cli/conf.d/xdebug.ini in the same way like for Apache. So write to the file
You can check it again via running simple script in command line mode. Create a project and replace the content of the index.php script with:
<?php phpinfo(); ?>
Select or create new run configuration, which will allow to run/debug this script in command line mode. You can do it in two ways. You can use the combo box in the main toolbar, where it's possible quickly switch between existing configurations or customize them. When you select the Customize... item from the combo box, the Project Properties dialog is opened and the Run Configuration panel is displayed. The second way is open Project Properties and select Run Configuration panel directly.
Create a new configuration or change the current one and in Run As combo box select Script (run in command line) item and close the dialog.
In the combo box in main toolbar should be selected the run configuration, which was selected in the dialog. Now run the script file or the project. After running the script you should be able to find in output window xdebug.remote_enable => On => On. When you put a breakpoint into the script, then during debugging the execution is stopped on the breakpoint.