PhpStorm:无法评估表达式 '$_SERVER[' SERVER_PORT']'

标签 php nginx phpstorm xdebug

我正在使用运行 PHP 7.1 (php-fpm) 和 Nginx 的 Docker 容器。我已经安装并启用了 Xdebug 2.5.0(如下图所示)。

enter image description here

我正在尝试使用“零调试配置”使用这行代码调试单个 index.php 文件:

<?php
    phpinfo();

但是我收到以下错误:

Cannot accept external Xdebug connection: Cannot evaluate expression '$_SERVER['SERVER_PORT']'

我搜索过类似的问题,我找到了 this但到目前为止没有任何帮助。

这里是PhpStorm调试相关的配置:

enter image description here enter image description here enter image description here enter image description here enter image description here

我不确定这里出了什么问题,所以我需要一些帮助来解决这个问题。带有 Dockerfile 等的存储库是 here .我正在使用以下版本的 PhpStorm:

PhpStorm 2016.3.2 EAP
Build #PS-163.10154.2, built on December 13, 2016
JRE: 1.8.0_112-release-408-b2 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

有什么可以帮我的吗?我在此设置中缺少什么?

最佳答案

这是因为你使用的是 unix: socket 而不是 TCP 协议(protocol)。 重新配置 PHP-FPM 和 NGINX 以使用 TCP

关于PhpStorm:无法评估表达式 '$_SERVER[' SERVER_PORT']',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41173659/

相关文章:

php - 无法使用Google PHP客户端库通过YouTube API设置水印

apache - 删除 Nginx 或 Apache 中的基本授权 header

phpstorm - PhpStorm 在哪里存储本地历史记录?

linux - Webstorm:Ctrl + 箭头不起作用。怎么修?

nginx - 如何在 CentOS 上使用 Nginx 设置两个具有两个不同端口的 block 服务器(基于 Ip)?

phpstorm - 如何在 PhpStorm 中的选项卡之间切换?

php - 如何使用javascript将相同的变量从php发送到两个不同的php页面

php - 无法在 codeigniter 平台中加载 css

php - 如何在发布请求后保持选择表单项?

ssl - nginx 简单 SSL 连接