Recently I updated my websites php from 5.6 to 7.2 but afterwards my website sometimes/often shows the internal server error message. I set debug to true and got the following errors:
PHP Warning: mysqli_query(): MySQL server has gone away in /var/www/wp-includes/wp-db.php on line 2033
PHP Warning: mysqli_query(): Error reading result set's header in /var/www/wp-includes/wp-db.php on line 2033
Does anyone have an idea how to fix this? I've tried to let wordpress repair the database but that didn't change anything.
Online I read everywhere that I should restore the database from a backup. I've made a backup just before updating my php but I'm wondering if that is the best course of action. First of all, won't that break the site again? Because now my site is running php 7.2 and that database is from php 5.6. And secondly, if that somehow also restores my php to 5.6, I need 7.2 for woocommerce.
Thanks!
mysql_queries
you're using have somehow been deprecated and no longer execute properly with PHP 7.2. But that'd only be if you've got custom written queries either in your theme or in some older plugin. Are all of your plugins and WordPress itself up-to-date. Take a look at WooCommerce status screen if you can access it and see if it gives you any warnings about your MYSQL being out of date or any of your plugins.