Question

I'm using Zend Studio to do remote debugging of my php scripts on a dev server. It works great for web code, but can I make it work with command line scripts?

I have several helper apps to make my application run. It would be really useful to fire up the remote debugger through command line instead of a web browser so I can test these out.

I assume it's possible, since I think Zend is using xdebug to talk to Eclipse. Apparently, it adds some parameters to the request to wake the Zend code up on a request. I'm guessing I'd need to tap into that?

UPDATE

I ended up using xdebug with protoeditor over X to do my debugging.

Was it helpful?

Solution

I was able to get remote CLI debugging working in Eclipse, using xdebug, though I've not tried it with the zend debugger. I would assume this should work the same with ZSfE, if that's the "Zend Studio" you're using.

OTHER TIPS

Since this is more along the lines of product support, your best bet is probably emailing the support people. We bought Zend Studio at my last job and they were always able to help us in a matter of hours.

Feel free to post the answer though, I am sure there are more people looking for it. :)

There's an option to debug a php script, run->run as->php script

I believe it also has to be in your project root though. Just for clarification, Zend studio uses their own debugger, while the eclipse pdt project you have the option for Xdebug or Zend's debugger.

Haven't tried, but you can set the QUERY_STRING environment variable to the one that toggles the Zend debugger on.

Per this article.

export QUERY_STRING=start_debug=1&debug_host=<host name or IP of the local machine>&debug_port=<the port that is configured in your ZDE settings>&debug_stop=1

And then run the CLI script.

Remote command-line debugging is possible, I just tried it. In my case I used Zend Studio + Zend Debugger.

This official article here by the Zend people will help you out, it's what I used. It explains all the parameters that must go into the shell command.

Make sure that you have the php.ini properly set on the remote server, and that it allows your IP address and it will work.

Also, you don't need to export the QUERY_STRING variable.

You can just do:

QUERY_STRING="start_debug=1&debug_host=[127.0.0.1]&no_remote=0&debug_port=10137&debug_stop=0" /path/to/php/binary /your/php/script.php

Running that on an SSH shell will light up your Zend Studio. Sweet!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top