docker php xdebug,在phpstorm和docker中的xdebug

我设法将xdebug与docker和phpstorm结合使用.对于http调用… IE

但是当我尝试运行我的phpunit测试时,它没有与phpstorm连接

我在phpstorm中执行了正确的目录映射,并在我的docker-instance export上运行了以下命令XDEBUG_CONFIG =“idekey = PHPSTORM”

我也试过我的docker:导出PHP_IDE_CONFIG =’serverName = web.docker’并在phpstorm web.docker上命名服务器配置.仍然在http而不是CLI上工作

那么我可以将phpstorm和xdebug一起用于命令行吗?

这是我的文件:/etc/php5/cli/conf.d/20-xdebug.ini

zend_extension=xdebug.so

xdebug.remote_enable=1

xdebug.idekey=PHPSTORM

xdebug.remote_connect_back=1

xdebug.remote_host=172.17.42.1

dxdebug.remote_autostart=1

当我打开日志记录,并使用xdebug_remote_host IP地址时,我得到了

W: Remote address not found, connecting to configured address/port: localhost:9000. :-|

E: Could not connect to client. :-(

Log closed at 2015-10-13 12:20:39

Log opened at 2015-10-13 12:22:58

I: Checking remote connect back address.

W: Remote address not found, connecting to configured address/port: 172.17.42.1:9000. :-|

E: Could not connect to client. :-(

Log closed at 2015-10-13 12:22:58

Log opened at 2015-10-13 12:23:58

I: Checking remote connect back address.

W: Remote address not found, connecting to configured address/port: 192.168.99.100:9000. :-|

E: Could not connect to client. :-(

Log closed at 2015-10-13 12:23:58

解决方案(编辑)

通过打开xdebug日志记录,我看到它已成功连接到192.168.99.1,因此解决了这个问题

xdebug.remote_host=192.168.99.1

解决方法:

我现在想到两件事:

> xdebug.remote_host是否设置正确?对于HTTP链接,您提供了192.168.地址,回来的路是172.17.地址.你可以ping那个IP上的主机吗?

>在您的ini文件中,它显示为:

dxdebug.remote_autostart=1

这只是一个错字,还是实际上在您的配置文件中?因为它应该读取前面没有“d”的xdebug.它应该是:

xdebug.remote_autostart=1

您应该只在执行脚本时添加选项时添加d,如下所示:

php -dxdebug.remote_autostart=1 script.php

如果这还没有帮助,请通过在配置中添加以下内容来启用远程日志:

xdebug.remote_log = /var/log/xdebug_remote.log

也许这有助于找到问题所在.

标签:php,docker,phpstorm,xdebug

来源: https://codeday.me/bug/20190519/1136555.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值