NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
CLI debugging on remote server

Joined: 03 Nov 2012
Posts: 1
Reply with quote
I'm running a PHP application on a remote CentOS server, and doing all development and debugging on my Windows box with PhpED 8.

For all regular debugging (i.e. for any page that can be loaded via a web browser) the debugger works brilliantly. The wizard configures things so that all files are mapped correctly and I have never had any difficulty.

The thing I'm having issues with is the CLI debugging. I can debug some scripts locally, but there are some scripts that (a) need to be run by cron against the php-cli (b) need to access other resources on the server and (c) will not run on my local windows box. For these reasons I need to be able to debug these scripts remotely.

If I pass the DBGSESSID string to the CLI when starting the script (e.g. /usr/local/php53/php-cli /var/www/script.php DBGSESSID=4@;d=1,p=0,c=1) then the debugger actually does pick up the debug session, but the file that is loaded in the PhpED editor is marked as [unmapped]. A further complication here is that the breakpoints don't always behave as I expect them to - sometimes a breakpoint that I add will not cause a break in execution and sometimes a breakpoint I remove will still cause a break.

I have also tried using the DebugBreak() function but this yields similar results.

If I run the debug wizard and select the 'command-line PHP' option, the wizard assumes I'm using php.exe on my windows box. How can I configure the debugger to work with remote php-cli and to correctly map server files to my local copies?

Thanks in advance ...
View user's profileFind all posts by JustinBusschauSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7917
Reply with quote
I'd recommend you the following:
-update to phped v9
-create sftp or ftp account to work with root directory of the host where you run your web
-create a new project
-run project settings wizard against your WEB root (yes web -- meaning remote HTTP, not CLI) -- http://yourwebsite/
-save the project and make sure it works with files in the root of your web (e.g. debugs them)
-open Run Mode page in project properties and update "Remote root directory" to point to PHYSICAL directory with your CLI files
-open Publishing page and update Top publishing directory to point to directory (from account's perspectives) with your CLI files. If account itself points to the physcial root directory of the host, Top publishing directory should be the same as remote directory for debugger
-project content (local directory) may remain empty

The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website

Joined: 30 Jun 2009
Posts: 79
Reply with quote
From 9055 build changelog:

- 0004266: [Bug report] Debugger won't load local file if CLI debug session is invoked remotely

Does 4266 address the issue reported above?

I had exactly the same problem and commented here, but everything I posted was deleted for some reason.

View user's profileFind all posts by temuriSend private message

Joined: 30 Jun 2009
Posts: 79
Reply with quote
YES! Finally, it's been fixed in 9055. I've just confirmed it.

Thank you!
View user's profileFind all posts by temuriSend private message
CLI debugging on remote server
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
All times are GMT - 5 Hours  
Page 1 of 1  

 Reply to topic