1 year ago

#74947

test-img

Naumov

How to configure PhpStorm with Xdebug in remote server on docker

I've done these steps:

  1. Setup remote server for deployment in PhpStorm.
  2. Setup docker server by SSH.
  3. Setup file map.
  4. Setup CLI Interpreter with remote docker.
  5. Map port 9003 from container to remote host, and forward this port by SSH to localhost.

Issues:

  1. "Run" test script not work with server + docker PhpStorm shows Could not open input file:/my/t.php message. I've tried changing path mapping to path/to/local/script, path/to/remote/script, path/to/docker/script and this did not do anything...
  2. "Validate Xdebug" did not worked because this validator creates a test file, uploads it to the server and try run the script. But my server run scripts from directory /pub/ but if I set this directory for upload script, PhpStorm adding /pub/ to the URL http://test.remote/pub and get answer 404
  3. I've tried to enable Listen for debug connection, enableed Xdebug extension in Google Chrome and set breakpoint on the first line, but connection was not established. Not working, I've checked 9003 port and it is allowed...
  4. I've tried to create test.php to try debugging a CLI script, but this doesn't work too, see point 1 "run" not working.

Software versions:

  1. PhpStorm - 2021.3
  2. PHP - 7.4
  3. Xdebug - 2.9.8

P.S. Sorry for my English.
P.P.S. I can't find manual how to setup PhpStorm, Xdebug with remote server in docker ((

php

docker

phpstorm

xdebug

0 Answers

Your Answer

Accepted video resources