【发布时间】:2019-07-04 16:08:33
【问题描述】:
我从 Mac 上的 Sierra 升级到 Mojave,升级并安装 php-fpm (php)、nginx 并写入新配置。
PHP 没有解析 php 代码,我可以在标题上看到它正在运行 PHP,甚至日志也显示了它。但是,当它呈现页面时,它是空白的。也没有有用的日志。
curl -v localhost.test/info.php * 尝试 127.0.0.1... * TCP_NODELAY 设置 * 连接到 localhost.test (127.0.0.1) 端口 80 (#0)
GET /info.php HTTP/1.1 主机:localhost.test 用户代理:curl/7.54.0 接受:/
[11-Feb-2019 15:21:30] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[11-Feb-2019 15:21:30] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[11-Feb-2019 15:21:30] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[11-Feb-2019 15:21:30] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[11-Feb-2019 15:21:30] NOTICE: fpm is running, pid 22336
[11-Feb-2019 15:21:30] NOTICE: ready to handle connections
目前获得了以下(全部通过 Homebrew 安装)。
- PHP 7.3.1
- NGINX 1.15.8
/usr/local/etc/nginx/nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
include servers/*;
}
/usr/local/etc/nginx/servers/localhost.conf
server {
listen 80;
server_name localhost.test;
access_log /usr/local/var/log/nginx/localhost.test.access.log;
index index.php;
root /Users/louie/Development/php;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}
}
这可能是什么原因导致它无法解析 PHP 代码?
【问题讨论】:
-
你可以在这里检查PHP-FPM是否正在运行stackoverflow.com/a/64673174/9185662
标签: php nginx macos-mojave