Tessando
asked on
How To Upgrade MYSQL after PHP Upgrade
I made a clone of my currently running Wordpress Server (in AWS) and upgraded PHP by using this command:
This worked, but munged up MySQL in the process.
When I hit the Wordpress site the error I get is:
"Your PHP installation appears to be missing the MySQL extension which is required by WordPress."
I made the PHP.info page (e.g. /phpinfo.php) and on the CLONE there is no MySQL listed, but on the original server (the one which I have NOT upgraded PHP on) there are a ton of MySQL.
I will admit that this look pretty old (mysqlnd 5.0.12-dev - 20150407).
That said, how can I update MySQL so that it matches the version of PHP that I upgraded to? Is this an easy fix or should I go about this a different way.
Thanks for your help.
sudo yum install -y php72
This worked, but munged up MySQL in the process.
When I hit the Wordpress site the error I get is:
"Your PHP installation appears to be missing the MySQL extension which is required by WordPress."
I made the PHP.info page (e.g. /phpinfo.php) and on the CLONE there is no MySQL listed, but on the original server (the one which I have NOT upgraded PHP on) there are a ton of MySQL.
I will admit that this look pretty old (mysqlnd 5.0.12-dev - 20150407).
That said, how can I update MySQL so that it matches the version of PHP that I upgraded to? Is this an easy fix or should I go about this a different way.
Thanks for your help.
It's not a problem with the MySQL server but with the 'mysql' extension in PHP. You have an old version of Wordpress. The current versions use the 'mysqli' extension which is not code compatible with the 'mysql' extension which is not available in recent versions of PHP.
Here is the 'man' page for the MySQL extensions.
https://www.php.net/manual/en/mysql.php
https://www.php.net/manual/en/mysql.php
Provide output of this command.
As Dave Baldwin suggested likely the mysql extension is missing. Also mbstring + zip have been moved out of core into extensions too, so likely will have to be installed for your site to work as expected.
Also, mention the original version of PHP you were running. WordPress core support all versions of PHP + many themes/plugins are badly implemented + will die instantly when PHP is upgraded.
You can set WP_DEBUG in your wp-config.php file, then check your debug.log file to see if this is a problem.
yum list installed | grep php
As Dave Baldwin suggested likely the mysql extension is missing. Also mbstring + zip have been moved out of core into extensions too, so likely will have to be installed for your site to work as expected.
Also, mention the original version of PHP you were running. WordPress core support all versions of PHP + many themes/plugins are badly implemented + will die instantly when PHP is upgraded.
You can set WP_DEBUG in your wp-config.php file, then check your debug.log file to see if this is a problem.
ASKER
Okay, that makes sense. Now that I know that the MySQL Plugin is deprecated for PHP, it looks like I can go with MySQLi. I did this by installing:
And now the only page that comes up for me is the Apache page. When I look at the Apache config (/etc/httpd/conf/httpd/con f) I see
Is there something I missed? Why would the Apache start page be showing and not my Wordpress site?
I am glad this is a copy of the website.
sudo yum install php-mysqli
And now the only page that comes up for me is the Apache page. When I look at the Apache config (/etc/httpd/conf/httpd/con
DocumentRoot "/var/www/html"
Is there something I missed? Why would the Apache start page be showing and not my Wordpress site?
I am glad this is a copy of the website.
ASKER
Per Davids request, here's the installation output:
[ec2-user@ip-10-0-30-201 conf]$ yum list installed | grep php
php56-cli.x86_64 5.6.40-1.142.amzn1 @amzn-updates
php56-common.x86_64 5.6.40-1.142.amzn1 @amzn-updates
php56-jsonc.x86_64 1.3.10-1.20.amzn1 @amzn-main
php56-mysqlnd.x86_64 5.6.40-1.142.amzn1 @amzn-updates
php56-pdo.x86_64 5.6.40-1.142.amzn1 @amzn-updates
php56-process.x86_64 5.6.40-1.142.amzn1 @amzn-updates
php56-xml.x86_64 5.6.40-1.142.amzn1 @amzn-updates
php72.x86_64 7.2.18-1.13.amzn1 @amzn-updates
php72-cli.x86_64 7.2.18-1.13.amzn1 @amzn-updates
php72-common.x86_64 7.2.18-1.13.amzn1 @amzn-updates
php72-json.x86_64 7.2.18-1.13.amzn1 @amzn-updates
php72-process.x86_64 7.2.18-1.13.amzn1 @amzn-updates
php72-xml.x86_64 7.2.18-1.13.amzn1 @amzn-updates
[ec2-user@ip-10-0-30-201 conf]$ yum list installed | grep php
php56-cli.x86_64 5.6.40-1.142.amzn1 @amzn-updates
php56-common.x86_64 5.6.40-1.142.amzn1 @amzn-updates
php56-jsonc.x86_64 1.3.10-1.20.amzn1 @amzn-main
php56-mysqlnd.x86_64 5.6.40-1.142.amzn1 @amzn-updates
php56-pdo.x86_64 5.6.40-1.142.amzn1 @amzn-updates
php56-process.x86_64 5.6.40-1.142.amzn1 @amzn-updates
php56-xml.x86_64 5.6.40-1.142.amzn1 @amzn-updates
php72.x86_64 7.2.18-1.13.amzn1 @amzn-updates
php72-cli.x86_64 7.2.18-1.13.amzn1 @amzn-updates
php72-common.x86_64 7.2.18-1.13.amzn1 @amzn-updates
php72-json.x86_64 7.2.18-1.13.amzn1 @amzn-updates
php72-process.x86_64 7.2.18-1.13.amzn1 @amzn-updates
php72-xml.x86_64 7.2.18-1.13.amzn1 @amzn-updates
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.