Home > Software engineering >  Wordpress on IIS - All pages returning Server Error 500 "blank" pages
Wordpress on IIS - All pages returning Server Error 500 "blank" pages

Time:04-29

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?

CodePudding user response:

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 );

CodePudding user response:

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!

  • Related