【问题标题】:Remote debugging (dev server is remote in a different network) with Xdebug and PhpStorm not connectingXdebug 和 PhpStorm 未连接的远程调试(开发服务器在不同的网络中远程)
【发布时间】:2019-07-23 04:40:57
【问题描述】:

我正在尝试使用 PhpStorm 和 Xdebug 调试与本地主机不同的网络中的开发环境。我尝试了很多方法,但找不到解决方法。

下面是我的php.ini文件设置:

zend_extension="/usr/lib/php5/20121212/xdebug.so"
xdebug.remote_host=192.168.0.101
xdebug.remote_connect_back=1
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.idekey="XDEBUG_ECLIPSE"
xdebug.remote_log="/tmp/xdebug.log"
xdebug.remote_handler=dbgp

由于我的开发服务器和调试环境不同,我提供了我的本地系统IP地址。

Xdebug 日志给出以下错误:

I:检查远程连接返回地址。
I:找到远程地址,连接到 192.168.1.1:9000。
E: 无法连接到客户端。 :-(

这个问题是不是因为我的本地服务器和开发服务器属于不同的网络?

【问题讨论】:

    标签: php magento phpstorm xdebug remote-debugging


    【解决方案1】:

    尝试从你的主机连接到 PHPSTORM

    nc -vz 192.168.1.1 9000
    

    如果成功,请从 dev 尝试相同的操作
    如果它从开发失败,是的,因为其他网络中的开发机器

    【讨论】:

    • 那么有什么替代解决方案呢?
    • 在主机上开发机器它的docker?
    • no.it 是一个简单的 linux 机器,有公共 IP.no docker 配置
    • 你需要端口转发ssh -L 9000:localhost:9000 dev将dev替换为你的开发机器的ip
    猜你喜欢
    • 2011-12-24
    • 2015-09-11
    • 2014-01-16
    • 2018-10-19
    • 2018-07-12
    • 2015-07-04
    • 2016-06-23
    • 2013-07-13
    • 2019-03-04
    相关资源
    最近更新 更多