宝塔面板PHPINFO信息空白

在宝塔5.9.2中,我安装Nginx1.14版,php为7.3.28。当我点击phpinfo,想要查看php开启的功能以及模块时,我发现没有任何信息输出,我使用探针也是没有任何信息,在网上搜索一番后,现给出可能的解决方案。

环境:Centos 7.9.2009 X64

1、检查PHP设置中是否开启短标签pathinfo,如下图:


2、检查是否禁用了phpinfo函数,如下图:


3、如果以上设置均搞好,重启php后还是没有的话,那我们就要看看是不是Nginx配置有问题了。

进入以下目录:/www/server/panel/vhost/nginx,查看phpinfo.conf文件(若没有,请先在php中查看一次phpinfo参数,他就会自动生成),文件代码大致如下:

server
{
    listen 80;
    server_name 127.0.0.2;
    allow 127.0.0.1;
    index phpinfo.php index.html index.php;
    root  /www/server/phpinfo;

	location /52 {
		include enable-php-52.conf;
	}
	location /53 {
		include enable-php-53.conf;
	}
	location /54 {
		include enable-php-54.conf;
	}
	location /55 {
		include enable-php-55.conf;
	}
	location /56 {
		include enable-php-56.conf;
	}
	location /70 {
		include enable-php-70.conf;
	}
	location /71 {
		include enable-php-71.conf;
	}
	location /72 {
		include enable-php-72.conf;
	}  
}

我们发现location /72 这种有点类似于php版本7.2,所以解决方法就是在后面增加:

location /73 {
		include enable-php-73.conf;
	}

增加后代码如下:

server
{
    listen 80;
    server_name 127.0.0.2;
    allow 127.0.0.1;
    index phpinfo.php index.html index.php;
    root  /www/server/phpinfo;

	location /52 {
		include enable-php-52.conf;
	}
	location /53 {
		include enable-php-53.conf;
	}
	location /54 {
		include enable-php-54.conf;
	}
	location /55 {
		include enable-php-55.conf;
	}
	location /56 {
		include enable-php-56.conf;
	}
	location /70 {
		include enable-php-70.conf;
	}
	location /71 {
		include enable-php-71.conf;
	}
	location /72 {
		include enable-php-72.conf;
	}  
	location /73 {
		include enable-php-73.conf;
	}
}

保存,重启Nginx,再点击phpinfo就发现可以正常显示了,如果需要添加其他的php版本,可以依葫芦画瓢。

所有评论(3)

  1. I savour, lead to I discovered just what I used too
    be having a look for. You’ve ended my four day long
    hunt! God Bleess yoou man. Have a nie day. Bye https://fortune-glassi.mystrikingly.com/

  2. Hi there! I know this is kinda off topic but I’d figured I’d ask.
    Would you be interested in exchanging links or maybe guest authoring
    a blog article or vice-versa? My site discusses a lot
    of thhe same topics as yours and I believe we could geatly benefit fro each other.
    If you might be interested feel free to sehd me an e-mail.
    I look forward to hearing from you! Terrific blog bby the way! https://Glassi-Greyhounds.Mystrikingly.com

  3. Hey There. I found your blog using msn. This is an extremely well written article.
    I will bbe sure to bookmark it and come back too reaqd more of your useeful
    info. Thanks for thee post. I’ll certainly comeback. https://Jobs.Askpyramid.com/companies/tonebet-casino/

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注