IIS上的WordPress-所有页面返回服务器错误500“空白”页面

发布于 2025-01-24 11:30:46 字数 328 浏览 5 评论 0原文

我有一个 Windows Server 2019 iis 上运行WordPress站点的机器

我有三个不同的WordPress站点。其中两个工作完美。但是,其中一个只是返回带有空白页面的“ 服务器错误500 ”代码。 (无论您尝试访问哪个页面,都可以这样做)。

我曾尝试启用“详细”错误页面(无论是在Localhost还是所有这些错误页面),但是所有页面都不断恢复空白(既可以在本地服务器上使用IE和Edge)。

有人知道我如何尝试获取一些的详细错误消息,以便我可以弄清为什么这个网站不起作用?

I've got a Windows Server 2019 machine running WordPress sites on IIS

I have three different WordPress sites. Two of them work perfectly. However, one of them just returns a "Server Error 500" code with a completely blank page. (it does this regardless of which page you try to access).

I have tried enabling "detailed" error pages (both on localhost and for all of them) but all of the pages just keep coming back blank (both using IE and Edge on the local server).

Does anyone know how I can try to get some kind of detailed error message so I can work out why this one site isn't working?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

琉璃繁缕 2025-01-31 11:30:46

由于您在IIS上,还有两项工作,但没有工作,我建议您首先查看损坏的站点web.config文件。确保所有设置和到位。

wp-config.php文件中,最简单的启用错误的位置。

注意:您必须在此之前插入
/*仅此而已,停止编辑!愉快的博客。 */
wp-config.php文件中。

// Enable WP_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 );

// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( 'SCRIPT_DEBUG', true );

Since you are on IIS, and two work but one doesn't, I'd suggest to first take a look at the broken sites web.config file. Make sure all that is setup and in place.

The easiest place to enable errors in WordPress is in the wp-config.php file.

NOTE: You must insert this BEFORE
/* That's all, stop editing! Happy blogging. */
in the wp-config.php file.

// Enable WP_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 );

// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( 'SCRIPT_DEBUG', true );
凡间太子 2025-01-31 11:30:46

感谢所有发布评论和答案的人。
最后,这是一个破裂的WordPress插件,导致其轰炸。

我最终通过检查 php错误日志(而不是查看Windows或IIS错误日志.. sigh )。

对于其他任何人,将来都会发现此问题,请导航到Windows Temp Directory,并在此处查找“ php*_Errors.log”文件。

在我的计算机上是:

%WINDIR%\temp\php55_errors.log

我网站的具体错误是Google Analytics(分析)插件删除:

[27-Apr-2022 09:31:57 UTC] PHP Fatal error:  Call to undefined function register_post_meta() in <...>\wordpress\wp-content\plugins\google-analytics-for-wordpress\includes\admin\meta-box.php on line 46

我只是从“插件”目录中删除了“ Google Analytics for WordPress”文件夹,一切都恢复了生命!

Thank you to everyone who posted comments and answers ..
In the end it was a broken Wordpress plugin which was causing it to bomb out.

I eventually found this out by checking the PHP Error Logs (rather than looking at Windows or IIS error logs .. sigh).

For anyone else finding this issue in future, navigate to the Windows Temp directory and look for a "php*_errors.log" file there.

On my machine it was:

%WINDIR%\temp\php55_errors.log

The specific error for my site was the Google Analytics plugin crapping out:

[27-Apr-2022 09:31:57 UTC] PHP Fatal error:  Call to undefined function register_post_meta() in <...>\wordpress\wp-content\plugins\google-analytics-for-wordpress\includes\admin\meta-box.php on line 46

I simply deleted the "google analytics for wordpress" folder from the "Plugins" directory and everything came back to life!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文