PHP-FPM不在OS X上的莫哈韦沙漠Nginx的运行

问题描述 投票:1回答:2

我从塞拉利昂升级我的Mac莫哈韦和升级的时候并安装PHP-FPM(PHP),nginx的和新的配置写道。

在PHP没有解析PHP代码,我就可以在它的运行PHP,甚至日志的标题看到显示它。但是,当它呈现的页面,它是空白。没有用的日志为好。

卷曲-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的User-Agent:卷曲/ 7.54.0接受:/ <HTTP / 1.1 200 OK <服务器:nginx / 1.15.8 <日期:星期一,2019年2月11日07:37 :17 GMT <内容类型:文本/ HTML;字符集= UTF-8 <传输编码:分块<连接:保活<X供电-通过:PHP / 7.3.1 <*连接#0到主机localhost.test原封不动

[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

目前得到了以下(通过家酿所有已安装的)。

  1. PHP 7.3.1
  2. NGINX 1.15.8

/US人/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/*;
}

/US人/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 nginx macos-mojave
2个回答
0
投票

确保〜.PHP是正确的。

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
        include        /usr/local/etc/nginx/fastcgi_params;
        fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME $document_root/$fastcgi_script_name;
    }

也涉及到nginx showing blank PHP pages


0
投票

如果页面是空白的,有最有可能在PHP的错误。替换一些简单的输出电流配置PHP页面:

<?php phpinfo();

如果这样的作品,你知道这个问题是你的PHP。

© www.soinside.com 2019 - 2024. All rights reserved.