1

OK, first things first. I started working on a new PHP project which, as in many cases, to put it mildly, built terribly. It is not possible, at this point, to copy the project to a local machine so I forced to work via FTP.

I would like to set up remote debugging, so the code will run remotely but I will be able to debug it locally.

The server is Amazon Linux, Apache, PHP 5.3.29 with xDebug v2.2.3.

php.ini:

zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000

I am trying to make in happen, according to many tutorials from the web, but it seems I am doing something wrong.

Somebody knows a working step-by-step configuration so I can set this up and forget?

1

1 Answer 1

1

If you want your IDE to connect to xDebug you need to set the remote host to the IP where your IDE runs.

Other option would be xdebug.remote_connect_back=1

see: https://xdebug.org/docs/all_settings

Sign up to request clarification or add additional context in comments.

2 Comments

I edit xdebug.remote_host to point to my IP (dev machine). I enabled PhpStorm to listen to debug connections but still does not work. Outbound port on remote machine is open. Inbound port on my dev machine is open. Still nothing happens. Why? - I set a breakpoint in the beginning of the code and refreshed the page...
Maybe a path mapping is needed for xdebug to tell which remote file relates to which local file. path mappings can be set in the IDE

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.