Remote Debugging with XDebug from inside a Docker Container does not work

后端 未结 4 1544
悲哀的现实
悲哀的现实 2021-02-07 04:31

I\'m trying to setup a dockered AMP environment and can\'t get the remote debugger working. My setup is as follows:

I have a database container running mysql which is wo

4条回答
  •  爱一瞬间的悲伤
    2021-02-07 05:32

    If you don't want do change xdebug config in the container and want to make it work using xdebug.remote_connect_back=1 you can set the HTTP-Header X-Forwarded-For to the IP of host.docker.internal und thus defines PHP $_SERVER['HTTP_X_FORWARDED_FOR'] which xdebug prefers and uses as the client IP instead of $_SERVER['REMOTE_ADDR'].

提交回复
热议问题