Page 1 of 1

Remote debugging in PHP

Posted: Wed Oct 21, 2009 10:59 am
by amusku
Hi,

I need help from you guys if any one of you knows about setting up the remote debugger for PHP.

I am trying with Xdebugger, which is freeware but I couldn't succeed in configuring the same in eclipse.

Here is my Development Environment details

I am running PHP stack on Linux virtual box.
1. apache 2.2.1
2. Mysql 5.0
3. PHP 4.3.9

Now I configured samba on my linux box and mounted the /data (which contains all the PHP source code) folder on my windows PC. I configured the same folder in my Eclipse PDT project.
Please note that Eclipse is running on my windows machine.

Before running the debugger in eclipse, I did installed Xdebugger in my linux box and did necessary changes in my PHP.ini file. Here is the out put of php -v command
[root@travelodge 4_3_x_comp]# php -v
PHP 4.3.9 (cgi) (built: Jul 16 2008 16:44:47)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans

Now I am trying to run the index.php file from the eclipse in debug mode, but the site is not getting launched. I did all the required changes in Eclipse also.

Please let me know if any one of you knows the resolution for this.

Thanks & Regards,
Ajaykumar Musku.

Re: Remote debugging in PHP

Posted: Fri Oct 23, 2009 1:13 pm
by Weirdan
If you want to debug web application you need to invoke it from browser. Eclipse 'Run' command won't do that for you.

You need to open the page you want to debug and then alter URL by appending XDEBUG_SESSION_START=blah parameter to query string (as detailed here: http://www.xdebug.org/docs/remote#browser_session). If everything is configured properly both on client and server side, your server will connect to your eclipse and eclipse will start debug session.