我已经安装了PhpStorm 2016.2.1(EAP),一切都应该工作正常但遗憾的是调试对我不起作用 . 我已经尝试从here零配置没有成功:(
Useful information:
-
我有一台运行CentOS 7的虚拟机,我有LAMP环境 .
-
/var/www/html/plataforma56.local
是项目所在服务器上的路径 -
远程路径通过SFTP映射到我的主机(使用SFTP Net)
-
PhpStorm下的项目类型为:"Source files are in a local directory, no Web server is yet configured" .
-
PHP版本是5.6.24
-
Xdebug版本是2.4.1
-
Xdebug已启用(参见下图)
- 我使用
phpinfo()
和Xdebug wizard page生成的HTML检查Xdebug,根据输出一切正常:
Summary
Xdebug installed: 2.4.1
Server API: Apache 2.0 Handler
Windows: no
Zend Server: no
PHP Version: 5.6.24
Zend API nr: 220131226
PHP API nr: 20131226
Debug Build: no
Thread Safe Build: no
Configuration File Path: /etc
Configuration File: /etc/php.ini
Extensions directory: /usr/lib64/php/modules
-
我正在运行Windows 10 x64
-
我的AV是ESET Smart Security(是的,我已经禁用了防火墙,只是为了看看这是否是根本原因但没有成功)
-
Xdebug配置中的IP /端口很好我已经多次检查过(甚至here在Communication Setup下是一个非常有用的动画,解释了发生了什么,所以我们可以正确理解)
-
使用端口
9005
在Windows上没有运行应用程序 -
phpStorm安装在具有IP的主机中:
192.168.3.1
-
IDE已配置
- 已配置路径映射
- SFTP连接正常工作
-
使用Xdebug Helper扩展程序在浏览器中启用了Xdebug(Chrome / Firefox都运行最新版本)...
-
在Cookies中......
- 在会话存储中(由我手动设置以防万一)
- 在本地存储中(由我手动设置以防万一)
- 最后小图标绿色说:扩展已启用
- 断点已设置多次,我还添加了一个程序性断点:
xdebug_break()
- 我还检查了端口是否在主机中打开并且正在监听,结果如下:
==================================================
Process Name : PhpStorm64.exe
Process ID : 7496
Protocol : TCP
Local Port : 9005
Local Port Name :
Local Address : 0.0.0.0
Remote Port :
Remote Port Name :
Remote Address : 0.0.0.0
Remote Host Name :
State : Listening
Process Path : C:\Program Files (x86)\JetBrains\PhpStorm 2016.2.1\bin\PhpStorm64.exe
Product Name : PhpStor
File Description : PhpStor
File Version : 2016.2.1.PS-162.1447.
Company : JetBrains s.r.o.
Process Created On: 8/6/2016 12:53:41 PM
User Name : REYNIERDESKTOP\ReynierPM
Process Services :
Process Attributes: A
Added On : 8/6/2016 1:54:39 PM
Module Filename :
Remote IP Country :
==================================================
最后,这是 /etc/php.ini
的配置块:
[Xdebug]
xdebug.remote_enable = true (I have play with true|1 here)
xdebug.remote_host = 192.168.3.1
xdebug.remote_port = 9005
xdebug.idekey = XDEBUG_PHPSTORM
xdebug.remote_handler = dbgp
xdebug.profiler_enable = 0
xdebug.remote_autostart = 1
xdebug.remote_log = "/tmp/xdebug.log"
拥有所有这些信息我应该问:
-
我在这里遗失了什么?
-
为什么这不起作用?
-
由于这是CodeIgniter 3项目,因此可以调试此应用程序吗? (虚拟问题,但由于某种原因可能不可能)
我在这里唯一缺少的是Xdebug日志,但我没有看到服务器上 /tmp/xdebug.log
下的任何文件(可能在我的配置上没有正确设置,你告诉我)
我对任何解决方案都持开放态度,因为我现在已经没有想法了,并且花了好几个小时试图让它工作(当你遇到需要解决的应用程序问题时,这是最好的)
Note: 我知道这是一个常见且经常发生的问题,已被多次询问,但在关闭之前,或标记为重复或投票请尝试帮助 .
我应该在这里补充一下,我已经阅读了这个帖子列表:
-
https://blog.jetbrains.com/webide/2011/03/configure-php-debugging-in-phpstorm-2-0/
-
xdebug running in PHPStorm unable to connect to remote server
-
XDebug with Symfony and PhpStorm doesn't work (Ubuntu installation)
我可以继续添加更多,因为我花了几个小时试图找到为什么不起作用 .
EDIT: Run/Debug configuration screen
3 回答
我已经使用php7.0.9 xdebug 2.4.0自定义端口安装了成功 . 我也使用FPM-FastCgi . phpv5.6仍然无法使用phpstorm和xdebug
同样的问题 . 我在vagrant VM机器和php56 xdebug 2.4.1上工作 . 远程调试不起作用!
我在流浪汉php7.0.10 xdebug2.4.1上运行同样的问题 . 我在
php.ini
中设置了xdebug.remote_autostart=1
选项,这解决了我的问题 .