在phpstorm和docker中的xdebug

weixin_38106215 2019-09-12 01:26:15
我设法将xdebug与docker和phpstorm结合使用.对于http调用… IE http://192.168.99.100:8081/?XDEBUG_SESSION_START=PHPSTORM 但是当我尝试运行我的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
...全文
29 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_38111004 2019-09-12
  • 打赏
  • 举报
回复
我现在想到两件事: > 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 也许这有助于找到问题所在.

476

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧