IntelliJ IDEA的远程PHP调试

我遇到类似的问题使用XDebug设置IntelliJ Idea远程调试,但由于没有发布任何解决方案,我还是会问它。</ p>
\ n

我有一个Raspberry Pi,Apache 2,PHP,xdebug在本地网络上设置并运行。</ p>

我有一个带IntelliJ IDEA的桌面和运行的PHP插件 同一个本地网络。 我已经成功地从IntelliJ建立了与远程服务器的SSH连接,所以当我点击“运行”时,它会自动将本地文件上传到Raspberry Pi并打开一个显示php网站的浏览器。 现在我希望能够进行调试。 我主要关注这个页面: https://www.jetbrains.com/ help / idea / 2016.3 / configured-xdebug.html ,但它无法正常工作。</ p>

当我点击调试时,浏览器会打开?XDEBUG_SESSION_START = 15930 </ 代码>附加到URL,我看到我的PHP网站。 在IntelliJ中,将打开调试器窗口,其中显示消息“正在等待与ide键的传入连接'15930'”。 每次调试时这个数字都会改变,所以我没有在php.ini中设置 xdebug.idekey </ code>。</ p>

这是我的php.ini的内容: </ p>

  [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
</ code> </ pre>

任何想法可能出错? 防火墙设置允许端口9000上的传入连接?</ p>
</ div>

展开原文

原文

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?

dongxuxian1123
dongxuxian1123 1)为这种不成功的调试会话收集xdebug日志(xdebug.org/docs/all_settings#remote_log),看看它会说些什么2)从phpinfo()输出中提供你的xdebug设置3)confluence.jetbrains.com/display/PhpStorm/...
3 年多之前 回复
dth54864
dth54864 谢谢你的建议Yury,但它不起作用:/
3 年多之前 回复

1个回答



对于遇到同样问题的人,可以通过检查服务器和客户端是否在指定的调试上建立适当的连接来找到答案 端口9000.由于在我的情况下客户端和服务器之间有多个路由器,并且我在这些路由器中的端口转发选项有限,我有点放弃了这种方法。</ p>

而是我安装了xampp 在我的客户端上进行本地调试而不是远程调试。</ p>
</ div>

展开原文

原文

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.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐