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://stackoverflow.com/questions/37310833/installing-xdebug-on-php-5-6-amazon-linux-ami 

以及远程服务器(EC2-Linux(上的PHP.ini文件中的xDebug配置:

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 连接或任何调试数据,我想你称之为它。

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

使用 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 帮助程序扩展并启用它。

最新更新