NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Debugging an "externally called" PHP on the server


Joined: 16 Feb 2013
Posts: 3
Reply with quote
My project contains two files, say Client.php and Server.php . Client.php is the startup file in projects settings. Client.php accesses Server.php using cURL (calling the URL "http ://office/Server.php?params-params") . If I start debugging the project from the IDE, the debugger doesn't stop on breakpoints set in Server.php - looks like the debugger doesn't get to know that Server.php is being loaded. Server.php code *is* executed, it's just debugger that doesn't "see" its execution.

Is there any chance for me to debug Server.php in IDE?
View user's profileFind all posts by mayevskiSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
You can use the DebugBreak() statement in your server code, which will cause DBG to be activated. DebugBreak() has a variety of ways of being used but most importantly if DBG does not know what the client address of your PhpED is, then DebugBreak must be told it DebugBreak('1@debugger-client-address')

Have a look at http://forum.nusphere.com/remote-debug-when-server-receives-a-request-t8269.html?highlight=debugbreak
View user's profileFind all posts by plugnplaySend private message


Joined: 29 Mar 2013
Posts: 17
Reply with quote
Thank you team so much for this feature. I'm testing PHPed 9 and this feature is amazing.

To those who are reading ... if you have a php file that you want to debug only when it gets called by something or someone else then place DebugBreak('1@X.X.X.X'); at the top of the php file and it will send debug info to that ip address. Amazing! Just make sure you have PHPed up and running at that IP address. You have to make sure firewalls, etc are all clear, naturally.
View user's profileFind all posts by pcuniteSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
note that sometimes you can't use IP address of target machine because it is in a different network behind NAT. For example you work from your home with public server. Server won't be able to connect to the IDE running on your home desktop. In this case you have to use either NAT mapping (see router settings) or uPnP or ssh tunnel. In latter case you need ssh service on the server. Ssh client is built into the IDE. With tunnel you'll use localhost or ::1 or 127.0.0.1.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Debugging an "externally called" PHP on the 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