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.

    评论

报告相同问题?

悬赏问题

  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多
  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败