phpstorm和xdebug之间的连接 [英] Connection between phpstorm and xdebug

查看:1698
本文介绍了phpstorm和xdebug之间的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我配置了phpstorm-xdebug,我能够使用断点来调试我的代码。
这几天我更新了php(通过brew)和xdebug,现在我有php 5.5.26与xdebug 2.3.3。
当我尝试调试测试(和代码)phpstorm告诉我:与xdebug的连接没有建立。

I configured phpstorm-xdebug and I was able to debug my code with breakpoints. These days I updated php (through brew) and xdebug and now I have php 5.5.26 with xdebug 2.3.3. When I try to debug tests (and code) phpstorm tells me: "connection with xdebug was not established".

我已经检查了xdebug的配置php.ini,它如下

I already checked the configuration of xdebug in php.ini and it's as follow

[xdebug]
zend_extension="/usr/local/opt/php55-xdebug/xdebug.so"
xdebug.remote_enable=1
xdebug.profiler_enable=1
xdebug.remote_port=9000
xdebug.remote_host=127.0.0.1
xdebug.idekey=PHPSTORM

,网络服务器调试验证说

and the web server debug validation says

I尝试使用不同版本的phpstorm,卸载e重新安装php55 / php55-xdebug但没有成功。

I tried with different versions of phpstorm, uninstalling e reinstalling php55/php55-xdebug but with no success.

你有什么想法如何解决问题?

Do you have any idea on how to solve the problem?

推荐答案

安装新的PHP后,如果您启动php-fpm而不正确配置,则默认在端口9000上侦听。您需要编辑的发行版的stockphp-fpm.conf:

After installing a new PHP, if you start php-fpm without configuring it properly, it defaults to listen on port 9000. Here is the 'stock' php-fpm.conf from the distro you need to edit:

/usr/local/etc/php/5.5/php-fpm。 conf

...

;   '[::]:port'            - to listen on a TCP socket to all addresses
;                            (IPv6 and IPv4-mapped) on a specific port;
;   '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000

它绑定端口9000,将其更改为另一个价值(在我的情况下更改为8001)。然后相应地配置你的apache的配置。这是我的配置示例config(apache 2.4),绑定到端口8001

It binds the port 9000, change it to another value (in my case changed it to 8001). Then configure your apache's config accordingly. Here is my config example config (apache 2.4), binding to port 8001

/usr/local/etc/apache2/2.4/extra/proxy-fcgi。 conf

ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:8001/usr/local/var/www/htdocs/$1
DirectoryIndex /index.php

重新启动apache和php-fpm,你很好地使用端口9000 for xdebug。开始PhpStorm。

restart apache and php-fpm, and you are good to go to use port 9000 for xdebug. Start PhpStorm.

这篇关于phpstorm和xdebug之间的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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