Switching PHP-FCGId to PHP-FPM returns blank site

OS: Ubuntu Linux 18.04.5, Webmin: 1.973, Virtualmin: 6.16, Usermin: 1.823, Authentic Theme: 19.73

I have a couple of WordPress sites on my Virtualmin server that are all using PHP-FCGId. I switched a few of them to PHP-FPM earlier today and now all those sites using PHP-FPM shows a blank page when opened.

The WordPress dashboard works fine on all of them however.

(I have tried switching them back to FCGI but that didn’t fix the blank page issue.)

What is causing this and how can I fix it?

Regards

@shillongserver,

Check your error log for clues as to what is going on… If no errors produce, make sure to enable “debugging” in WordPress so that it’s a bit more verbose.

Best Regards,
Peter Knowles | TPN Solutions

Affordable, Professional IT Support – https://tpnassist.com

1 Like

@tpnsolutions I enabled WP_DEBUG on one of the affected sites and when I open the site, I get the following error:

[05-Apr-2021 05:48:31 UTC] PHP Fatal error: Uncaught Error: Undefined constant “_S_VERSION” in /home/site1/public_html/wp-content/themes/gsl-theme/functions.php:100
Stack trace:
#0 /home/site1/public_html/wp-includes/class-wp-hook.php(292): customScripts()
#1 /home/site1/public_html/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters()
#2 /home/site1/public_html/wp-includes/plugin.php(484): WP_Hook->do_action()
#3 /home/site1/public_html/wp-includes/general-template.php(3009): do_action()
#4 /home/site1/public_html/wp-content/themes/gsl-theme/header.php(20): wp_head()
#5 /home/site1/public_html/wp-includes/template.php(730): require_once(’…’)
#6 /home/site1/public_html/wp-includes/template.php(676): load_template()
#7 /home/site1/public_html/wp-includes/general-template.php(48): locate_template()
#8 /home/site1/public_html/wp-content/themes/gsl-theme/front-page.php(10): get_header()
#9 /home/site1/public_html/wp-includes/template-loader.php(106): include(’…’)
#10 /home/site1/public_html/wp-blog-header.php(19): require_once(’…’)
#11 /home/site1/public_html/index.php(17): require(’…’)
#12 {main}
thrown in /home/site1/public_html/wp-content/themes/gsl-theme/functions.php on line 100

What could be causing this because I have switched from PHP-CFGI to PHP-FPM for another site on another server a few months back and this problem didn’t occur.

Could it be related to the PHP version since I was using PHP 7 back then and using PHP 8 now?

I temporarily fixed this by adding the following code snippet to the affected file:

if ( ! defined( '_S_VERSION' ) ) {
	define( '_S_VERSION', '1.0.0' );
}

But I would like to find out why switching PHP-CFGI to PHP-FPM caused this problem though.

@shillongserver,

Yes, it could be related to PHP 8 as this is a major release which comes with lots of changes. While as I understand it WordPress itself is compatible with PHP 8, it’s quite possible that a plugin or theme you are using is not.

Best Regards,
Peter Knowles | TPN Solutions

@tpnsolutions Thanks for the assistance Peter. Cheers!

Never, ever, ever, ever, ever use the latest version of anything on Wordpress for at least 6 months after it comes out.

Here’s how the flow typically works:

  • PHP 8 is released
  • Wordpress works on compatibility for about two weeks
  • By the end of month 1, Wordpress is compatible
  • Wordpress sends notices to developers that they need to provide function for PHP8
  • Depending on your developer, you may get it in a year. Maybe not at all, especially depending on the template you’re using.

So never, ever, ever, ever, ever upgrade to the latest PHP version on Wordpress. Or anything else for that matter until at least 6 months after it’s released.

@shillongserver,

At the very least, before upgrading make sure that any plugins, templates and the core being used is compatible. If not, reach out to see when or if it will ever be compatible. Sometimes a good developer just needs a nudge from its users to motivate them to start working out any quirks or at least confirm their code will continue working with the new version.

But yeah, as @Gomez_Adams has stated, 6 to 12 months after a new “major” release is made of most software is a good time frame for waiting for the developers to catch up. Sometimes the changes are massive so it might take a while, and sometimes the new software version might itself change a bit so developers delay their interest in making compatible until things have stabilized.

If it’s been over 6 - 12 months since the major software has been released and the developers of plugins and/or templates still haven’t moved on making necessary adjustments, you’ve nudged them and they haven’t really taken interest… Then it may be time to make the difficult decision to find an alternate plugin/theme to meet your needs.

I typically recommend you keep an eye on plugins/themes developed by third parties to ensure they remain actively developed. A plugin for instance that has had NO activity for more than 6 months may actually be dead and should be removed from your install to prevent issues; security or otherwise.

Best Regards,
Peter Knowles | TPN Solutions

1 Like