【发布时间】:2015-06-05 13:42:17
【问题描述】:
在以下 IP 下,我的容器在我的 Web 浏览器中运行成功
我还创建了一个卷来在我的容器和我的文件系统之间共享文件
docker run --name lampf -d -p 32775:80 -v /Users/sja/Sites/lamkepf2:/var/www/html --link=lampf_db:db codinglimo/apache_php540_gs_imgmck_pdflib9
现在我在我的容器中也成功安装了 xDebug,并带有以下 xdebug.ini
zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
xdebug.remote_enable=on
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=0
xdebug.profiler_output_dir="/temp/profiledir"
PHPStorm 也配置好了
http://img2.picload.org/image/iowdpww/xdebug.png
但是我的 index.php 中的断点被忽略了吗? 我的错误是什么?
问题在 Sergey 的帮助下得以解决
我的新 xdebug.ini
zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
xdebug.remote_enable=on
#xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_connect_back=On
xdebug.remote_handler=dbgp
xdebug.profiler_enable=0
xdebug.profiler_output_dir="/temp/profiledir"
【问题讨论】:
-
也许你应该在
xdebug.remote_host中设置你的主机IP? -
谢谢,我删除 xdebug.remote_host=127.0.0.1 并设置 xdebug.remote_connect_back=On
-
它可能对其他人有用,但我还必须设置路径映射以将本地文件映射到它们在容器中的安装位置。 Settings > Languages & Frameworks > PHP > Servers 然后添加一个新的
-
你是如何运行你的容器的?我主要对端口映射感兴趣。是否将容器的 9000 端口映射到外部的 9000 端口(@987654327@)?
标签: php docker phpstorm xdebug boot2docker