Database Cache causing 503 errors when upgrading to PHP 7
-
Hi,
I have a WordPress installation (4.9.8) with W3 Total Cache (0.9.7) on a LiteSpeed/Apache shared server and PHP 5.6. All is working fine.
In W3TC I have enabled: Page Cache (Disk: Enhanced), Minify (Disk), Database Cache (Disk), and Browser Cache.
If I upgrade to PHP 7.2 (or 7.1 or 7.0), the website returns a 503 error (only for not logged-in users – the admin area is still accessible).
In my logs, I have this:
PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/~/public_html/wp-includes/wp-db.php:1564 Stack trace: #0 /home/~/public_html/wp-content/plugins/w3-total-cache/DbCache_Wpdb.php(145): wpdb->db_connect(true) #1 /home/~/public_html/wp-includes/wp-db.php(592): W3TC\DbCache_Wpdb->db_connect() #2 /home/~/public_html/wp-content/plugins/w3-total-cache/DbCache_Wpdb.php(252): wpdb->__construct('redacted', 'redacted', 'redacted', 'redacted') #3 /home/~/public_html/wp-content/plugins/w3-total-cache/DbCache_WpdbInjection.php(38): W3TC\DbCache_Wpdb->default_initialize() #4 /home/~/public_html/wp-content/plugins/w3-total-cache/DbCache_Wpdb.php(152): W3TC\DbCache_WpdbInjection->initialize() #5 /home/~/public_html/wp-content/plugins/w3-total-cache/DbCache_Wpdb.php(379): W3TC\DbCache_Wpdb->initialize() #6 /home/~/public_html/wp-content/plugins/w3-total-cache/DbCache_WpdbInjection_QueryCaching.php(229): W3TC\_CallUnderlying->initialize() in /home/~/public_html/wp-includes/wp-db.php on line 1564
Which makes me think that W3TC’s Database Cache is struggling when on PHP 7.
Reverting back to PHP 5.6 fixes the problem.
Am I missing anything obvious, and does anyone know if there’s any quick win to get around this?
Thanks in advance!
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Database Cache causing 503 errors when upgrading to PHP 7’ is closed to new replies.