FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Debugging PHP with Netbeans

 
Post new topic   Reply to topic    NetBeans Forums -> PHP Users
View previous topic :: View next topic  
Author Message
Markus Wolff
Posted via mailing list.





PostPosted: Tue Nov 25, 2008 10:45 pm    Post subject: Debugging PHP with Netbeans Reply with quote

Hello Netbeaners,

I'm new to this list and to using Netbeans as a PHP IDE - in fact, I'm
still in the process of evaluating it as a potential replacement for
PDT / Zend Studio. Let's see how it turns out.

First impression: Really cool. Everything seems to work out-of-the-box.
There's one problem though, regarding debugging.

When I initially setup a project, I have to declare an index page. For
my test project, this is:

trunk/document_root/index.php

I'm using Zend Framework, so this script is the single point of entry
for all calls to any action within the project.

I also set up a virtual host in Apache for my project, which is:

http://marjory.local/

To try debugging the project, I press CTRL-F5, select server-side PHP
(without Javascript) and press OK. Next, the browser is opened with the
following URL:

http://marjory.local/trunk/document_root/index.php?XDEBUG_SESSION_START=netbeans-xdebug

Ookay, it's quite clear what's happening: The location of the index page
relative to the Netbeans project root is appended to the host address.
That's a nice idea but as the document root is in the document_root
folder, this address can never be found.

How can I fix this? How can I tell Netbeans where the real document root
is, and enter a real path to the index file (which Netbeans validates,
so I can't enter a path that does not exist).

Also, the actual file name "index.php" may not be mentioned in the URL,
or the rewrite rule in the virtual host won't work.

Here's what the URL should look like when starting a debug session:

http://marjory.local/?XDEBUG_SESSION_START=netbeans-xdebug

Is this possible?

Regards,
Markus
Back to top
radek matous
Posted via mailing list.





PostPosted: Wed Nov 26, 2008 8:58 am    Post subject: Debugging PHP with Netbeans Reply with quote

Hi,

Try change Web Root. See
http://www.netbeans.org/kb/docs/php/project-setup.html#sources

Radek

Markus Wolff wrote:
Quote:
Hello Netbeaners,

I'm new to this list and to using Netbeans as a PHP IDE - in fact, I'm
still in the process of evaluating it as a potential replacement for
PDT / Zend Studio. Let's see how it turns out.

First impression: Really cool. Everything seems to work out-of-the-box.
There's one problem though, regarding debugging.

When I initially setup a project, I have to declare an index page. For
my test project, this is:

trunk/document_root/index.php

I'm using Zend Framework, so this script is the single point of entry
for all calls to any action within the project.

I also set up a virtual host in Apache for my project, which is:

http://marjory.local/

To try debugging the project, I press CTRL-F5, select server-side PHP
(without Javascript) and press OK. Next, the browser is opened with the
following URL:

http://marjory.local/trunk/document_root/index.php?XDEBUG_SESSION_START=netbeans-xdebug

Ookay, it's quite clear what's happening: The location of the index page
relative to the Netbeans project root is appended to the host address.
That's a nice idea but as the document root is in the document_root
folder, this address can never be found.

How can I fix this? How can I tell Netbeans where the real document root
is, and enter a real path to the index file (which Netbeans validates,
so I can't enter a path that does not exist).

Also, the actual file name "index.php" may not be mentioned in the URL,
or the rewrite rule in the virtual host won't work.

Here's what the URL should look like when starting a debug session:

http://marjory.local/?XDEBUG_SESSION_START=netbeans-xdebug

Is this possible?

Regards,
Markus






Back to top
Markus Wolff
Posted via mailing list.





PostPosted: Thu Nov 27, 2008 10:53 pm    Post subject: Debugging PHP with Netbeans Reply with quote

Hey Radek,

good call, it's better now, but still not perfect:

Netbeans now calls...
http://marjory.local/index.php?XDEBUG_SESSION_START=netbeans-xdebug

...but what I'm aiming for is...
http://marjory.local/index/?XDEBUG_SESSION_START=netbeans-xdebug

...or, even better:
http://marjory.local/?XDEBUG_SESSION_START=netbeans-xdebug

Nevermind though, I can still start debug sessions by typing the URL
manually, would just have been nice to do it via a shortcut from within
the IDE.

CU
Markus

radek matous schrieb:
Quote:
Hi,

Try change Web Root. See
http://www.netbeans.org/kb/docs/php/project-setup.html#sources

Radek

Markus Wolff wrote:
Quote:
Hello Netbeaners,

I'm new to this list and to using Netbeans as a PHP IDE - in fact, I'm
still in the process of evaluating it as a potential replacement for
PDT / Zend Studio. Let's see how it turns out.

First impression: Really cool. Everything seems to work out-of-the-box.
There's one problem though, regarding debugging.

When I initially setup a project, I have to declare an index page. For
my test project, this is:

trunk/document_root/index.php

I'm using Zend Framework, so this script is the single point of entry
for all calls to any action within the project.

I also set up a virtual host in Apache for my project, which is:

http://marjory.local/

To try debugging the project, I press CTRL-F5, select server-side PHP
(without Javascript) and press OK. Next, the browser is opened with the
following URL:

http://marjory.local/trunk/document_root/index.php?XDEBUG_SESSION_START=netbeans-xdebug


Ookay, it's quite clear what's happening: The location of the index page
relative to the Netbeans project root is appended to the host address.
That's a nice idea but as the document root is in the document_root
folder, this address can never be found.

How can I fix this? How can I tell Netbeans where the real document root
is, and enter a real path to the index file (which Netbeans validates,
so I can't enter a path that does not exist).

Also, the actual file name "index.php" may not be mentioned in the URL,
or the rewrite rule in the virtual host won't work.

Here's what the URL should look like when starting a debug session:

http://marjory.local/?XDEBUG_SESSION_START=netbeans-xdebug

Is this possible?

Regards,
Markus












Back to top
radek matous
Posted via mailing list.





PostPosted: Fri Nov 28, 2008 10:33 am    Post subject: Debugging PHP with Netbeans Reply with quote

Markus Wolff wrote:
Quote:
Hey Radek,

good call, it's better now, but still not perfect:

Netbeans now calls...
http://marjory.local/index.php?XDEBUG_SESSION_START=netbeans-xdebug

...but what I'm aiming for is...
http://marjory.local/index/?XDEBUG_SESSION_START=netbeans-xdebug

...or, even better:
http://marjory.local/?XDEBUG_SESSION_START=netbeans-xdebug

Nevermind though, I can still start debug sessions by typing the URL
manually, would just have been nice to do it via a shortcut from within
the IDE.

CU
Markus

Hi,
we are aware of problems in this area, we are going to collect feedback,
evaluate and improve it into NB 7.0

thanks
Radek
Quote:
radek matous schrieb:

Quote:
Hi,

Try change Web Root. See
http://www.netbeans.org/kb/docs/php/project-setup.html#sources

Radek

Markus Wolff wrote:

Quote:
Hello Netbeaners,

I'm new to this list and to using Netbeans as a PHP IDE - in fact, I'm
still in the process of evaluating it as a potential replacement for
PDT / Zend Studio. Let's see how it turns out.

First impression: Really cool. Everything seems to work out-of-the-box.
There's one problem though, regarding debugging.

When I initially setup a project, I have to declare an index page. For
my test project, this is:

trunk/document_root/index.php

I'm using Zend Framework, so this script is the single point of entry
for all calls to any action within the project.

I also set up a virtual host in Apache for my project, which is:

http://marjory.local/

To try debugging the project, I press CTRL-F5, select server-side PHP
(without Javascript) and press OK. Next, the browser is opened with the
following URL:

http://marjory.local/trunk/document_root/index.php?XDEBUG_SESSION_START=netbeans-xdebug


Ookay, it's quite clear what's happening: The location of the index page
relative to the Netbeans project root is appended to the host address.
That's a nice idea but as the document root is in the document_root
folder, this address can never be found.

How can I fix this? How can I tell Netbeans where the real document root
is, and enter a real path to the index file (which Netbeans validates,
so I can't enter a path that does not exist).

Also, the actual file name "index.php" may not be mentioned in the URL,
or the rewrite rule in the virtual host won't work.

Here's what the URL should look like when starting a debug session:

http://marjory.local/?XDEBUG_SESSION_START=netbeans-xdebug

Is this possible?

Regards,
Markus



















Back to top
johnkramlich



Joined: 29 Sep 2009
Posts: 1
Location: St. Louis, MO

PostPosted: Tue Sep 29, 2009 12:49 am    Post subject: Solution for NetBeans 6.7 and Zend Framework Reply with quote

My temporary solution under NetBeans 6.7.1 is to specify a fake localhost as my webserver. When you start the debugger it will launch the web browser and try to connect to the server, which does not exist. While it is attempting to connect to this nonexistent server you can load the URL you want via FireFox with the xDebug addon installed ( https://addons.mozilla.org/en-US/firefox/addon/3960 ). Ensure that you enable the addon and that it's icon in the status bar is green. This causes the next HTTP request from FireFox to connect with the NetBeans PHP debugger and you are able to step through you code as you like.

I use this method to debug my Zend Framework projects.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> PHP Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB