php wp-admin 显示空白页面,如何解决?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17607611/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 16:09:52  来源:igfitidea点击:

wp-admin shows blank page, how to fix it?

phpwordpress

提问by Anandkumar Mehta

I am working with WordPress 3.5.8. Yesterday I made some changes into it to a friend. I don't know what happened, but after some time when I try to log in at wp-admin side and execute URL www.mysite.com/wp-adminit shows me a blank page. How do I solve this? I have searched over the internet and blogs. I found it could be related to hosting problems or brute force-attack, but I don't think that that's what happened to my site.

我正在使用 WordPress 3.5.8。昨天我给朋友做了一些修改。我不知道发生了什么,但是一段时间后,当我尝试在 wp-admin 端登录并执行 URL 时,www.mysite.com/wp-admin它向我显示了一个空白页面。我该如何解决这个问题?我在互联网和博客上搜索过。我发现这可能与托管问题或蛮力攻击有关,但我认为这不是我的网站发生的情况。

Links I visited:

我访问的链接:

回答by user2982829

After dozens of times trying to fix this problem reading forums and posts, reinstalling WordPress, removing white spaces, putting lines of code in wp-config.php, index.php, admin.php, I fixed the issue just by renaming the pluginsfolder to "pluginss"in FTP. So wordpress asked me to update the database. I updated and I could enter at /wp-admin. A plugin was causing some conflict, so when I rename the pluginsfolder, all plugins automatically has been disabled.

在阅读论坛和帖子、重新安装 WordPress、删除空格、将代码行放在 wp-config.php、index.php、admin.php 中数十次尝试解决此问题后,我仅通过将plugins文件夹重命名为"pluginss"在 FTP 中。所以wordpress让我更新数据库。我更新了,我可以在/wp-admin. 一个插件导致了一些冲突,所以当我重命名plugins文件夹时,所有插件都自动被禁用。

As I was inside the /wp-admindashboard, I could rename the "pluginss"folder to the regular name and start to activate all the plugins one by one and see what plugin was broken.

当我在/wp-admin仪表板中时,我可以将"pluginss"文件夹重命名为常规名称并开始一个一个激活所有插件,看看哪个插件坏了。

Now is 100% fine.

现在是 100% 罚款。

回答by mathielo

Try turning on WP Debug. If this is happening due to a PHP error (which I bet that it is), you will be able to see what's going on and fix the error.

尝试打开WP Debug。如果发生这种情况是由于 PHP 错误(我敢打赌它是),您将能够看到发生了什么并修复错误。

回答by oneintheword

Go to your functions.phppage and delete any spaces immediately above or below your PHPtags.

转到您的functions.php页面并删除PHP标签正上方或下方的所有空格。

回答by Ravi Mane

I faced the same problem and I tried many things such as trying to login through wp-login.php instead of /wp-admin and adding ob_start() in /wp-admin/index.php (if you hit the url /wp-admin it goes for /wp-admin). It showed login page but entering the username and password shows an error like "cookies are blocked due to unexpected output".

我遇到了同样的问题,我尝试了很多方法,例如尝试通过 wp-login.php 而不是 /wp-admin 登录,并在 /wp-admin/index.php 中添加 ob_start()(如果您点击 url /wp- admin 它用于 /wp-admin)。它显示登录页面,但输入用户名和密码显示错误,例如“由于意外输出,cookies 被阻止”。

I finally got the solution: it happens because the theme or plugins that you installed are not supported.

我终于得到了解决方案:这是因为您安装的主题或插件不受支持。

How to check and fix:

如何检查和修复:

  • Rename the plugin folder name and theme folder name.If opening /wp-admin and entering a valid username and password the dashboard is shown, then it worked.

  • Revert the folder name of plugin and theme, then activate the themes and plugins one by one, cross-checking with /wp-admin. You will find out the unsupported plugin or theme.

  • 重命名插件文件夹名称和主题文件夹名称。如果打开 /wp-admin 并输入有效的用户名和密码,仪表板就会显示出来,那么它就可以工作了。

  • 恢复插件和主题的文件夹名称,然后将主题和插件一一激活,与/wp-admin交叉检查。您会发现不受支持的插件或主题。

回答by moks

All your problem is solved right now just follow this instruction:

您的所有问题现在都已解决,只需按照以下说明操作:

  1. go to your themes then de activate your current theme, just put "x" in the the first letter of your theme name.
  1. 转到您的主题然后取消激活您当前的主题,只需在主题名称的第一个字母中输入“x”即可。

for example this is your theme folder name: "mytheme" just put "x" in the first letter like this "xmytheme" tho di activate.

例如,这是您的主题文件夹名称:“mytheme”只需将“x”放在像“xmytheme”这样的第一个字母中即可激活。

  1. Then after that go back to your wp-admin panel then BOOM! wp-admin accessable.

  2. When you access your wp-admin panel or you are on your dashboard, again activate your theme again, but before that. REMOVE THE "X" letter you putted in your theme name. example: "xmytheme" just remove "x", output like this: "mytheme"

  3. then activate it in your dashboard.
  1. 然后回到您的 wp-admin 面板,然后 BOOM!wp-admin 可访问。

  2. 当您访问 wp-admin 面板或在仪表板上时,再次激活您的主题,但在此之前。删除您放在主题名称中的“X”字母。示例:“xmytheme”只需删除“x”,输出如下:“mytheme”

  3. 然后在您的仪表板中激活它。

hope this help!.

希望这有帮助!。

回答by Harrison Morph

I also had a blank screen for my blog. The solution was to copy up a backup copy of wp-config,php somehow the 'live' wp-config.php had been replaced with a file size of zero.

我的博客也有一个空白屏幕。解决方案是复制 wp-config,php 的备份副本,以某种方式将“实时” wp-config.php 替换为文件大小为零。

In my case I had the same problem. Helped remove the wp-config.php file. Wordpress created new wp-config.php file and wp-admin is working flawlessly now. Rename plugins, themes folder does not help.

就我而言,我遇到了同样的问题。帮助删除 wp-config.php 文件。Wordpress 创建了新的 wp-config.php 文件,并且 wp-admin 现在可以完美运行。重命名插件,主题文件夹没有帮助。

回答by lanosmind

I ran into the same problem a few minutes ago, the problem was when I uploaded my local theme I had a bunch of tags separating each function I had in there I solved this by putting all the functions in one php tag... Hope this helps.

几分钟前我遇到了同样的问题,问题是当我上传我的本地主题时,我有一堆标签分隔我在那里的每个功能我通过将所有功能放在一个 php 标签中解决了这个问题......希望这个有帮助。

回答by PeterCat

[6] was spot on. I had the same problem ie a blank screen where wp-admin should have been Renaming plugins to pluginss let me get back in.

[6] 恰到好处。我遇到了同样的问题,即 wp-admin 应该将插件重命名为 pluginss 让我重新进入的空白屏幕。

I also had a blank screen for my blog. The solution was to copy up a backup copy of wp-config,php somehow the 'live' wp-config.php had been replaced with a file size of zero.

我的博客也有一个空白屏幕。解决方案是复制 wp-config,php 的备份副本,以某种方式将“实时” wp-config.php 替换为文件大小为零。

It seems that it is very important to have an off-line backup The easy way to copy of the files is Filezilla (freeware)

看来离线备份很重要复制文件的简单方法是Filezilla(免费软件)

You need a wordpress plugin for database backup - ie to back up all your pages and posts. But the pros will tell you that you need to get a

您需要一个用于数据库备份的 wordpress 插件 - 即备份您的所有页面和帖子。但是专业人士会告诉你,你需要得到一个

Peter

彼得

回答by javad m

I had this problem (not showing /wp-admin/), when I moved my site to new host. i solve this problem by: 1. Re mane activated theme's folder 2. Install that them again and active it 3. copy and re place some customized file like .css .js from backup

当我将网站移动到新主机时,我遇到了这个问题(未显示 /wp-admin/)。我通过以下方式解决了这个问题: 1. 重新激活激活主题的文件夹 2. 再次安装它们并激活它 3. 从备份中复制并替换一些自定义文件,如 .css .js

Now problem solved.

现在问题解决了。

回答by Zaid

It might be because of a few reasons:

可能是因为以下几个原因:

  1. Problems in your web host.
  2. Theme related errors(You can change it by renaming theme folder).
  3. Plugin related errors(You can change it by renaming plugin folder).
  4. An Empty line in your wp-config file.
  5. Code errors that can be seen by enabling Debug mode.

    "define('WP_DEBUG', true); // Enable Debug logging to the /wp-content/debug.log file define( 'WP_DEBUG_LOG', true );

    // Disable display of errors and warnings define( 'WP_DEBUG_DISPLAY', false ); @ini_set( 'display_errors', 0 );"

  6. Remove blank space in functions.php or you can also remove the last "?>"
  1. 您的虚拟主机中的问题。
  2. 主题相关错误(您可以通过重命名主题文件夹来更改它)。
  3. 插件相关错误(您可以通过重命名插件文件夹来更改它)。
  4. wp-config 文件中的空行。
  5. 通过启用调试模式可以看到的代码错误。

    "define('WP_DEBUG', true); // 启用调试日志记录到 /wp-content/debug.log 文件中 define('WP_DEBUG_LOG', true);

    // 禁止显示错误和警告 define( 'WP_DEBUG_DISPLAY', false ); @ini_set('display_errors', 0);"

  6. 删除functions.php中的空格或者您也可以删除最后一个“?>”