我已经走到了尽头,真的可以使用一些帮助!
这是我的设置 -
location ~ .php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
listen=127.0.0.1:9000
通过以上配置,NGINX 可以正常显示 PHP 页面。
现在,我想设置 Xdebug。所以我在/etc/php.d/xdebug.ini 文件中添加了以下内容
<code>
zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=x.x.x.x
xdebug.remote_port=9009
xdebug.remote_autostart=1
</code>
注意远程端口设置为 9009 与 PHP-FPM 端口 9000 不冲突。
在 x.x.x.x 机器上,我让 XDebugClient 运行监听端口 9009 上的传入连接。
接下来,我从主机 x.x.x.x 启动浏览器并请求 URL http://y.y.y.y?XDEBUG_SESSION_START=1 (其中 y.y.y.y)是带有 NGINX、PHP-FPM 和 XDebug 设置的服务器。
问题 - 没有任何 react 。 XDebugClient 永远不会获得连接!
我错过了什么?
最佳答案
检查事项
这些是我必须经历很多次的基本步骤。希望其中一个会有所帮助。
关于PHP调试环境不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36271058/