Xdebug的安装在EC2 Linux实例,并使用PhpStorm用于远程调试开发

问题描述:

这里是我的设置:Xdebug的安装在EC2 Linux实例,并使用PhpStorm用于远程调试开发

调试/从本地环境中开发

IDE: PhpStorm 10 
url for setting up my PhpStorm debugging: https://blog.jetbrains.com/phpstorm/2011/03/configure-php-debugging-in-phpstorm-2-0/ 
PHP interpreter version (local copy): 5.6 

远程AWS EC2-Linux的安装:

xdebug for php56-devel 

I used this SO answer for my xdebug setup: https://*.com/questions/37310833/installing-xdebug-on-php-5-6-amazon-linux-ami 

和这个xdebug配置在远程服务器(ec2-linux)上的php.ini文件中:

Add to /etc/php-5.6.ini the following line : 
zend_extension = /usr/lib64/php/5.6/modules/xdebug.so 
xdebug.remote_autostart=on 
xdebug.remote_enable=on 
xdebug.remote_enable=1 
xdebug.remote_handler="dbgp" 
xdebug.remote_host= THE.IP.ADRESS.OF.THE.COMPUTER.THAT.WILL.REMOTE.DEBUG.THE.SERVER 
xdebug.remote_port=9000 
xdebug.remote_mode=req 
xdebug.idekey = xdebug 

但我仍然没有从我的PhpStorm从服务器或任何调试数据,我想你称之为任何传入连接。

我在做什么错?我错过了什么?

+0

您是否检查过端口9000是否打开? – Scopey

+0

您是否使用书签或扩展名来启动Xdebug会话?设置PhpStorm调试的网址*真*旧。请参阅https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm。 –

+0

是9000端口是开放的。 – Dave2345

使用PHP 5.4,Amazon Linux EC2实例。在我的系统上安装PhpStorm。通过SFTP将部署服务器配置到我的EC2实例。让Xdebug开始监听请求。

我添加以下行/etc/php.d/xdebug.ini

zend_extension=/usr/lib64/php/modules/xdebug.so 
xdebug.remote_autostart=on 
xdebug.remote_enable=on 
xdebug.idekey=PhpStorm1 
xdebug.remote_connect_back = On 

xdebug.remote_connect_back确保它被配置为机器正在发送IP请求,即我正在开发的系统。

不要忘记重新启动服务器。例如,

sudo service httpd restart 

此外,您必须安装您正在测试并启用浏览器的Xdebug的助手扩展。