Setting up Remote Debugging with PHP Storm

Many occasions you’ll encounter that the frontend resides on a different server than where the backend code is. Or you may be making a CURL request to a remote server. In such situations – the PHP Storm Debugger or the Browser may not be able to get debug information for the remote server.

Solution: Create a proxy server on the remote server. Link the proxy server to the local debugger and the client on your desktop. Now – the proxy intermediates between your requests and the response from the server and thereby you are able to set breakpoints and debug code executing on the backend server.

Steps to follow

1. Refer to configuration settings on

2. Install Python Library for Proxy setup on the remote server. Use Komodo Python Remote Debugging Client –

3. Install xdebug on the remote server (

4. Modify the php.ini file under /etc/php5/apache2 and add the following lines:

; Enable Xdebug

5. Create a batch file with the following lines of code to execute the python proxy server:

#!/bin/bash -f
cd /usr/local/src/Komodo-PythonRemoteDebugging-7.1.2-73175-linux-x86/bin
#while [ $? == 1 ]
while true;  do
  echo Starting pydbgpproxy at `date`
  ./pydbgpproxy -i -d 9000

9001 is the client port and 9000 is the local port. The above line translates to redirecting all traffic from port 9001 to port 9000.

6. Restart Apache2 Server

7. Modify the client port on the PHP Storm IDE. Settings > PHP > Debug > XDebug > Debug Port – Set to 9001

8. Click on the icon that looks like a phone to start listening to incoming traffic on port 9001.

9. Modify DBGp configuration on PHP Storm. Tools > DBGp Proxy > Configuration


Host: IP Address of the Remote Server

Port: 9001

10. Register the IDE. Tools > DBGp Proxy > Register IDE. A successful message is shown on the screen.

11. Restart PHP Storm

12. Setup Debug Configuration and Directory Mappings for your project in PHP Storm

13. When a CURL call is made to the remote server, modify the call to include this paramter in the URL:


14. Add Frontend and Backend server sto the XDebug settings on your Chrome browser

15. NOTE: Do Not select the debuggin options on the browser when trying to debug the remote server.

16. Start the Debugger for the project. Activate remote listening using the phone icon. Register the IDE, add Breakpoint in the code on the remote server.

Enjoy debugging!!!