A
A
agreIT2020-03-26 17:12:32
openvpn
agreIT, 2020-03-26 17:12:32

How to connect OpenVPN to Xdebug running in Docker on a remote machine?

There is a remote server with containers:

  1. PHP-FPM + XDebug
  2. Nginx
  3. MySQL
  4. OpenVPN by image

XDebug Configuration

xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_port=9005
xdebug.remote_log=/var/log/xdebug_remote.log
xdebug.idekey=PHPSTORM
xdebug.remote_connect_back=1


How to properly configure OpenVPN on the server so that when xDebug is connected to PHPStorm, it actively catches breakpoints.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Ratanov, 2020-03-30
@Q911

according to this instruction
1. connect via openvpn, take assigned ip
2. pass ip via environment variable XDEBUG_CONFIG="remote_host={{YOUR_IP_ADDRESS}}"to PHP-FPM container
3. Intellij/PHPStorm: Languages ​​& Frameworks > PHP > Debug > DBGp Proxy
set ip and port
4. Map folders to code in IDE and docker

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question