未登录时,wordpress wp-admin/php.ini导致空白页 [英] wordpress wp-admin/php.ini causes blank page when not logged in

查看:96
本文介绍了未登录时,wordpress wp-admin/php.ini导致空白页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个可以正常运行且正常运行的网站.

We have a site that is up and running and working fine.

我们最近有一项增加文件上传限制的任务,为此,我们添加了以下行的php.ini文件.

We recently got a task to increase the file upload limit, to do this we added a php.ini file with the following lines.

upload_max_filesize = 64M
post_max_size = 64M

当放置在根目录中时,我们可以看到它正在生效(通过检查根目录中的phpinfo文件),但是直到将php.ini文件复制到wp-admin文件夹中后,它才对管理员有效.

When placed in the root we could see it taking effect (by checking phpinfo file in root) but it wouldn't work for admin until we copied the php.ini file into the wp-admin folder.

此后,我们可以成功上传较大的文件,并且前端和后端均未显示任何问题.

After this we could successfully upload larger files and the front and back end showed no issues.

直到两天后我们才注意到的一个问题是,如果您未登录,则/wp-admin/网址会显示空白页面.

An issue we didn't notice until a couple days later is that the /wp-admin/ url shows a blank page if you are not logged in.

您仍然可以通过wp-login.php网址登录,登录后一切都将正常运行.

You can still log in via the wp-login.php url and everything will work correctly once you are logged in.

我已经检查了错误日志,什么也没发现.仅当我们删除/重命名php.ini文件时,它才会开始工作.我也尝试过在php.ini中打开调试或删除所有内容以拥有一个空的php.ini文件,但所有这些更改仍然会导致/wp-admin/url为空.

I've checked the error logs and found nothing . it will only start working when we remove/rename the php.ini file. I've also tried turning on debuging in the php.ini or removing everything to have an empty php.ini file but all these changes still cause a blank /wp-admin/ url.

我还尝试编辑/wp-admin/index.php文件,添加以下几行.添加回显和die语句行得通,但是尝试导致错误报告打印却没有.

I also tried editing the /wp-admin/index.php file adding the following lines. Adding echo and die statements worked but trying to cause error report printing did not.

// this works
echo "test a";
die;

// this does not
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

网站信息

Wordpress版本4.8.1

Wordpress version 4.8.1

PHP版本7.0.25

PHP Version 7.0.25

推荐答案

wordpress wp-includes文件夹 default-constants.php'文件编辑WP_MEMORY_LIMIT

wordpress wp-includes folder default-constants.php'file edit WP_MEMORY_LIMIT

观看视频: https://www.youtube.com/watch?v=ojCnNgvWt9E

这篇关于未登录时,wordpress wp-admin/php.ini导致空白页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆