Xdebug无法与PHPStorm一起使用 [英] Xdebug not working with PHPStorm

查看:119
本文介绍了Xdebug无法与PHPStorm一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将PHPStorm和Xdebug一起使用来逐步检查我的代码. PHPStorm在Windows 7计算机上运行,​​而我的本地Web服务器在另一台CentOS 6.4计算机上运行.我已经完成了phpinfo();来验证Xdebug是否已被PHP加载.以下是PHP.ini中我的Xdebug的设置:

I use PHPStorm along with Xdebug to step through my code. PHPStorm is running on a Windows 7 machine, and my local webserver is running on a separate CentOS 6.4 machine. I've done a phpinfo(); to verify that Xdebug is being loaded by PHP, and it is. The following are the settings for my Xdebug in the PHP.ini:


    [xdebug]
    zend_extension="/usr/lib/php/modules/xdebug.so"
    xdebug.remote_enable = 1
    xdebug.remote_port = 9000
    xdebug.remote_host = "192.168.1.130"
    xdebug.remote_log = "/var/log/httpd/xdebug_log"
    

同样,我将PHPStorm设置为将CentOS服务器用作调试服务器,并监听连接.我为这两台机器都分配了静态IP.使用Chrome Xdebug插件设置适当的Cookie,我尝试设置一个断点,但是没有任何反应.当我去查看/var/log/httpd/xdebug_log(具有777权限)时,那里什么也没有写.我已经打开了端口9000,并且可以在端口9000上从CentOS计算机远程登录到Windows计算机.我也将SELinux设置为宽松,但无济于事.

I similarly setup PHPStorm to use my CentOS server as the debugging server, and I listen for connections. I assigned static IPs to both of these machines. Using a Chrome Xdebug plugin to set the appropriate cookies, I attempt to set a breakpoint, but nothing happens. When I go to look in /var/log/httpd/xdebug_log (which has 777 permissions), nothing is written there. I've opened up port 9000, and I can telnet from my CentOS machine back to my Windows machine on port 9000 no problem. I also set SELinux to permissive, but to no avail.

有什么想法吗?

推荐答案

尝试在PhpStorm中配置项目

Try to configure your project in PhpStorm

  1. 打开设置->语言和框架-> PHP->调试
  2. 取消选中通过未注册的服务器配置忽略外部连接"选项
  3. 确定

这篇关于Xdebug无法与PHPStorm一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆