小编wbr*_*uan的帖子

NginX + PHP-FPM 显示空白的 php 页面

我有一个问题,我的服务器运行带有 php-fpm 的 NginX 加载空白的 PHP 页面(奇怪的是我的 phpinfo.php 文件除外,它正常加载)。如果我将 index.html 页面放在同一目录中并浏览到它,它就会加载。phpinfo.php(调用 phpinfo(); 函数)加载的事实证实了 php-fpm 可以工作。

我希望有人可以给一些建议。对于我将要提供的大量信息,我提前道歉,但我宁愿提供太多信息也不愿提供太少信息。这是我的配置文件。

/etc/nginx/conf.d/default.conf:

server {
    listen   80;
    server_name  45.55.182.120;

    #charset koi8-r;
    #access_log  /var/log/nginx/log/host.access.log  main;

        root   /usr/share/nginx/html;
        index  index.php index.html index.htm;

    location / {
       try_files $uri $uri/ =404;
    }

    error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    # …
Run Code Online (Sandbox Code Playgroud)

linux bash centos nginx

7
推荐指数
1
解决办法
2万
查看次数

标签 统计

bash ×1

centos ×1

linux ×1

nginx ×1