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.