Home  >  Article  >  Backend Development  >  phpinfo不显示怎么办

phpinfo不显示怎么办

PHPz
PHPzOriginal
2016-06-13 10:12:213581browse

phpinfo不显示怎么办

phpinfo不显示的解决办法:

今天调试lnmp环境,出现如下报错。无法查询到php信息。

企业微信截图_15929638394716.png

环境:linux版本CentOS Linux release 7.3.1611 (Core),nginx使用tengine。php和tengine均为源码安装到/usr/local。

首先确认tengine已经启动,在网站根目录下写了个静态测试网页,测试没问题,可以正常显示。

确认php-fpm已经启动,查询服务端口正常。怀疑tengine的php支持没有配置。

打开/usr/local/tengine/conf/vhost下面的*.conf主机配置,修改以下配置:追加index.php让nginx服务器默认支持index.php为首页,同时通过注释,启用相关配置。注意$document_root的位置,可以写成$document_root,也可以写成网站根目录,但是一定不能是默认的/scripts。

location / {
      root  /var/www/html;
      index index.html index.htm index.php;
    }
...
...
location ~ \.php$ {
      root      /var/www/html;
      fastcgi_pass  127.0.0.1:9000;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include    fastcgi_params;
    }
...
...

同时,确保/usr/local/php/etc/php-fpm.conf的配置:

listen = 127.0.0.1:9000

然后,重启服务就可以了。

企业微信截图_15929638444958.png

更多相关技术文章,请访问PHP中文网

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn