phpinfo 只在 nginx 上显示一个空白页面

问题描述

我目前正在学习 Nginx,并试图显示 PHPinfo。 但它只显示这样的空白页面

phpinfo blank

以下是我迄今为止确定/尝试过的内容

find / -name *fpm.sock
/run/PHP/PHP7.4-fpm.sock
root@Nginx-fundamentals:/sites/demo# cat info.PHP
<?PHP PHPinfo(); ?>
root@Nginx-fundamentals:~# ps aux | grep Nginx
root        1056  0.0  0.3   8720  3212 ?        Ss   Jun20   0:00 Nginx: master process /usr/sbin/Nginx
www-data  104677  0.0  0.3   9140  3684 ?        S    Jul06   0:00 Nginx: worker process
root      112008  0.0  0.2   8160  2496 pts/0    S+   04:03   0:00 grep --color=auto Nginx
root@Nginx-fundamentals:~# ps aux | grep PHP
root       11018  0.0  1.0 195484 10496 ?        Ss   Jun21   1:52 PHP-fpm: master process (/etc/PHP/7.4/fpm/PHP-fpm.conf)
www-data   11020  0.0  0.4 195872  4756 ?        S    Jun21   0:00 PHP-fpm: pool www
www-data   11021  0.0  0.4 195872  4756 ?        S    Jun21   0:00 PHP-fpm: pool www
root      112010  0.0  0.0   8160   736 pts/0    S+   04:03   0:00 grep --color=auto PHP
root@Nginx-fundamentals:/etc/Nginx# cat Nginx.conf
user www-data;
events {}
 
http {
    include mime.types;
    server {
 
      listen 80;
      server_name XX.XXX.XXX.117;
 
      root /sites/demo;
      index index.PHP index.html;
 
      location / {
        try_files $uri $uri/ =404;
      }
 
      location ~\.PHPs$ {
        # Pass PHP requests to the PHP-fps service (fastcgi)
        include fastcgi.conf;
        fastcgi_pass unix:/run/PHP/PHP7.4-fpm.sock;
      }
    }
}

我做错了什么? 我还应该调查什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)