I was having great difficulty debugging the CLI frontend of PEAR, and decided to ask the friendly folks at Zend if there is a solution that would allow stepping through it using ZDE. Incredibly, there is an ingenious solution that works perfectly. To quote Nitsan from Zend suport:
Preferences -> Debug tab -> select the Server option and enter your web server host name in the “Debug Server URL” field).
On the server machine set the environment variable QUERY_STRING to:
start_debug=1&debug_host=<host name or IP of the localmachine>&debug_port=<the port that is configured in your ZDEsettings>&debug_stop=1 I.e. setenv QUERY_STRING start_debug=1&debug_host=<host name orIP of the local machine>&debug_port=<the port that isconfigured in your ZDE settings>&debug_stop=1 [Make sure to fill the appropriate host name and port number. The portnumber can be found in ZDE->Tools->Preferences->Debugtab->"Client Debug Port" field]. Next, on the client machine open ZDE and open the script file. Click on the
Go/Go to Cursor icons (F5 or Shift+F10 buttons) and the script should be debugged remotely on the server.
I tried this on my Windows XP home system, using PHP 5.0.3 and ZDE 3.5.2 and this command:C:> set “QUERY_STRING=start_debug=1&debug_host=192.168.0.102&debug_port=10000&debug_stop=1″ Then, I tried running “pear run-scripts PEAR_Server” and voila, ZDE opened up pearcmd.php and has allowed me to step through it, but I can answer the prompts that will populate php://stdin. Very cool!