IntelliJ PHP调试器未连接 [英] IntelliJ PHP debugger not connecting
问题描述
我已将以下行添加到我的php.ini中:
[xdebug]
zend_extension = / usr / local / Cellar / php56 / 5.6.24 / lib / php / extensions / no-debug-non-zts-20131226 / xdebug.so
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_port =9000
当我运行 php -v
我得到:
Zend Engine v2。 6.0,版权所有(c)1998-2016 Zend Technologies
与Xdebug v2.4.0版权所有(c)2002-2016,Derick Rethans
和 phpinfo()
显示
xdebug.remote_enable On On
xdebug.remote_port 9000 9000
但IntelliJ显示:
xdebug.remote_enable 0
,我指向正确的 php.ini
(当文件为e时,检查路径和其他更改出现[/ p>
我尝试所有配置(包括使用IDE密钥),但没有任何效果。
有没有办法,我可以检查调试是否真的正常工作(即是不是IDE不能识别或者是服务器有问题),因为在这一点上我不知道问题可能是什么。
最好的方法是收集 xdebug log 以进行这样一个不成功的调试会话,看看它是什么不得不说有时候调试不起作用(IDE显示没有任何反应),但是xdebug实际上连接到某处只是很好(例如,另一个服务如下所述)。
有机会您将在您的计算机上运行 php-fpm
(取决于您如何安装PHP - 您使用的工具)。默认情况下,Php-fpm使用与xdebug相同的TCP 9000端口。
sudo lsof -nP -iTCP -sTCP:LISTEN
在终端中运行此命令 - 它应该告诉(过滤结果 9000
关键字)哪些服务已经在该端口上收听。
如果确实是 php-fpm
..然后将xdebug端口从默认值$ $ $ $ $ $ 9000 更改为任何其他(例如 9001
或任何其他通常未使用的端口)在两个IDE设置中,php.ini将解决问题。
I've set up php 5.6 and Apache on my Mac and have IntelliJ with the php plugin installed (2016.2). The problem is that the IDE doesn't want to connect to the local server.
I've added the following lines to my php.ini:
[xdebug]
zend_extension=/usr/local/Cellar/php56/5.6.24/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_port = "9000"
and when I run php -v
I get:
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans
and phpinfo()
shows
xdebug.remote_enable On On
xdebug.remote_port 9000 9000
But IntelliJ shows:
xdebug.remote_enable 0
I've checked, that I'm pointing to the right php.ini
(checked path and other changes appear when the file is edited).
I tried all configurations (including with an IDE key) but nothing seems to work.
Is there a way I can check if the debugging is really working (i.e. is it the IDE not recognizing something or is the server faulty), because at this point I don't know what the problem may be.
The best way is to collect xdebug log for such unsuccessful debug session to see what it has to say. Sometimes debug does not work for you (IDE shows no reaction) but xdebug actually connects somewhere just fine (e.g. another service .. as described below).
There is a chance that you will have php-fpm
running on your computer (that depends on how you installed your PHP -- what tool you have used for that). Php-fpm by default uses the same TCP 9000 port as xdebug does.
sudo lsof -nP -iTCP -sTCP:LISTEN
Run this command in terminal -- it should tell (after filtering results on 9000
keyword) what services are already listening on that port.
If it's indeed php-fpm
.. then changing xdebug port from default 9000
to any other (e.g. 9001
or any other usually unused port) in both IDE settings + php.ini will solve the issue.
这篇关于IntelliJ PHP调试器未连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!