I have recently updated my Ubuntu version from 16.04 to 18.0.4 with PHP version upgraded to 7.2. I haven't been able to log on to my Wordpress websites due to the following error:
Your php installation appears to be missing the mysql extension which is required by Wordpress
What I have tried:
- sudo apt-get update & sudo apt-get -y install php-mysql
- sudo update-alternatives --set php /usr/bin/php7.2
* while checking if the last one worked with wp --info, I also got the following warning:
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20170718/mysqli (/usr/lib/php/20170718/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/mysqli.so (/usr/lib/php/20170718/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
These were in fact missing from php.ini. I added both
extension=/usr/lib/php/20170718/mysqli
and
extension=/usr/lib/php/20170718/mysqlnd.
The PHP warning disappeared, but the MySQL extension still seems to be missing.
The php.ini file is located at /etc/php/7.2/cli/php.ini. I restarted apache after each change I made.
Would you have any other solution that might work?
Thanks a lot in advance.