Ubuntu, PHP, NetBeans - part III

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

xdebug.remote_enable=on

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.


Comments:

Wow! This is a wonderful fearture!

Guys you're are this close to supporting other interpreters :)

Just a few things that I've noticed:

1) Every time you run the script it opens up a new tab in the output window. This can eventually lead to many tabs and can get confusing.

2) I'm unable to type in my own php interpreter path and file name. I can only click the configure button to configure the main php interpreter. I would like to have an option to add a separate interpreter on a per project basis. This would mean that I can configure php5.2, php5.3 or even php6.0 interpreters for individual projects.

Well so far so good! It's looking great!

Posted by raymond on July 17, 2008 at 10:30 AM CEST #

Great Post!

Posted by Oscar Cala on July 17, 2008 at 12:24 PM CEST #

Hi raymond,

ad 1) Which build do you use? You can find it in the About dialog or copy the content of the last text area in the Aboug dialog. I'm asking, because the behavior in the latest development build is ok.

ad 2) I have entered new enhancement base on your comment. http://www.netbeans.org/issues/show_bug.cgi?id=140623. Increase the priority, if you think that this is important for you.

Thanks,
Petr

Posted by Petr on July 17, 2008 at 03:00 PM CEST #

Hi Petr,

Thanks for posting the issue but I dont think 140623 is a duplicate of issue 13561. This request is to allow a user to enter a separate php interpreter on a per project basis. It's kind of like having an option to choose separate run configuration with with customized interpreters.

I'm using Build 200807090008 - Netbeans 6.5 M1

Posted by raymond on July 18, 2008 at 10:23 AM CEST #

Hi all,

sorry for submit to this old blog, but i want to further now about how to limit output windows to not open tabs every times script run

Posted by Anton Heryanto on November 04, 2008 at 04:59 AM CET #

It was a very nice idea! Just wanna say thank you for the information you have shared. Just continue writing this kind of post. I will be your loyal reader. Thanks again.

Posted by links of london on October 29, 2009 at 08:20 PM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blogs is written by NetBeans developers who contribute to the PHP support mainly.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today