How can I use PHPEd to debug PHP CLI scripts on a remote ser |
Guru master
|
I don't myself debug PHP CLI scripts, but a few things that may assist.
1. Often CLI PHP uses a different config to the web PHP, so you might have to add the DBG debugger to a different php.ini and add suitable debugger config settings. 2. Whilst CLI PHP itself does not use a web server, as far as I am aware neither does the NuSphere DBG debugger except for detecting things like debug cookies. The debugger interfaces between PHP and the client PHP DBG Listener (which starts when PhpED starts). It communicates with the client using port 7869 (by default). 3. Double-check firewall settings where-ever PHP is running to ensure it allows port 7869 through. 4. You may need to use the DebugBreak() statement to invoke the debugger at a suitable point in your script. DebugBreak can be told how to communicate with the PhpED client. Once the debugger is invoked, breakpoints, etc. will start working. 5. You will find various information about DebugBreak in this forum but have a look at http://forum.nusphere.com/remote-debug-when-server-receives-a-request-t8269.html?highlight=debugbreak and http://forum.nusphere.com/how-to-use-dbgsessid-t8348.html?highlight=debugbreak |
||||||||||||
|
|
This is not a shared hosting environment, it's a standard UNIX/FreeBSD install so there is only one php.ini. The setup wizard comes back all green, and as long as the script is being run by Apache, everything is fine, so there can't be any connection problems. The only time there is a problem is with CLI scripts. DebugBreak has the recommended public IP of the development machine, although if I put the CLI script in the web root on the same machine, debug works fine with it, and doesn't even need the break, since it will automatically stop on the first line of the script. Of course in the real world that won't work because CLI scripts need parameters.
I have it working. No amount of posts helped. It came from studying the parameters and figuring out how it all works. |
||||||||||||
|
Site Admin
|
Did you try the follwoing?
php myscript.php DBGSESSID=1@MyPhpedMachineIP:7869 To determine MyPhpedMachineIP, you can invoke phpinfo() through Apache's php and copy _SERVER['REMOTE_ADDR'] value. |
||||||||||||
_________________ The PHP IDE team |
How can I use PHPEd to debug PHP CLI scripts on a remote ser |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by