duannao3402 2016-12-29 11:26
浏览 563

IntelliJ IDEA的远程PHP调试

I have a similar problem to Setting up IntelliJ Idea remote debugging with XDebug, but since no solution was posted there I'll ask it anyways.

I have a Raspberry Pi with Apache 2, PHP, xdebug set up and running on a local network.

I have a desktop with IntelliJ IDEA and the PHP plugin running in the same local network. I already successfully made an SSH connection to the remote server from IntelliJ, so when I hit "Run" it automatically uploads local files to the Raspberry Pi and opens a browser showing the php website. Now I want to be able to debug as well. I followed this page mostly: https://www.jetbrains.com/help/idea/2016.3/configuring-xdebug.html, but it is not working.

When I hit debug the browser opens with ?XDEBUG_SESSION_START=15930 appended to the URL and I see my php website. In IntelliJ the Debugger window opens with the message "Waiting for incoming connection with ide key '15930'". This number changes every time I hit debug, so I have not set xdebug.idekey in php.ini.

This is the contents of my php.ini:

[XDebug]
zend_extension = /usr/lib/php5/20131226/xdebug.so
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.remote_host=192.168.2.108
xdebug.show_exception_trace=On
xdebug.remote_handler=dbgp
xdebug.remote_conneck_back=1

Any ideas what might be wrong? Something with firewall settings to allow incoming connections on port 9000?

  • 写回答

1条回答 默认 最新

  • dongzhang1875 2017-01-10 19:14
    关注

    For those struggling with the same problem, the answer probably can be found by checking if your server and client make appropriate connections on the specified debug port 9000. Since in my situation there are multiple routers between the client and server and my port forwarding options in those routers are limited I kind of gave up on this approach.

    Instead I installed xampp on my client and went for local debugging instead of remote debugging.

    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作