PHP installation appears to be missing the MySQL extension
Hi
If I use PHP Version 7.2.17 on a WordPress site - I get the following error:
"Your PHP installation appears to be missing the MySQL extension which is required by WordPress."
My cpanel server has PHP Version 7.2.17 installed.
(also has PHP 5.6, 7.0 and 7.1 installed but only Version 7.2.17 is the problem)
WHM is Version 78.0.20
I am wondering what "yum" command I should use to install the necessary
MySQL extension on PHP Version 7.2.17
PHP info for Version 7.2.17 does not show MySql
it does say
Loaded Configuration File /opt/cpanel/ea-php72/root/etc/php.ini
extension_dir /opt/cpanel/ea-php72/root/usr/lib64/php/modules
Thanks for your help
Audrey
-
What version of WordPress are you using? 0 -
What version of WordPress are you using?
Wordpress version is not important. MySQL should already be installed on your WHM server. What you will need is the PHP libraries/extensions to interact with MySQL. @audrey so what you do is if you have Easy Apache 4 installed in your WHM you use that system to add MySQL. Please review the MySQL documentation. Yum is available from the WHM Terminal or SSH on your server.0 -
as stated in my post - I want to use yum Just looking for the correct yum command Is this the correct yum command to install th emysql extension on PHP Version 7.2.17 ? yum install php72w-mysql 0 -
Wordpress version is not important.
I beg to differ... but OK.0 -
I beg to differ... but OK.
With respect, please can you explain how WordPress versions effect MySQL installs? Thanks.0 -
Is this the correct yum command to install th emysql extension on PHP Version 7.2.17 ? yum install php72w-mysql
I believe this may work; However, I have foundyum install php-mysql
andyum install php-mysqli
Both of these should possibly be run before trying more specific modules. source serverfault.com/a/8743650 -
With respect, please can you explain how WordPress versions effect MySQL installs? Thanks.
Extremely old versions of WordPress rely on the mysql_connect() function in PHP. mysql_connect() was deprecated in PHP 5.5 and removed in PHP 7.0. If the user is using PHP 7.0+ and using a script that relies on mysql_connect() then it won't work. Older versions of WordPress that rely on mysql_connect() generate this particular error message verbatim when run on a PHP 7.0+ system.0 -
Thanks - but - none of these commands worked to solve the error yum install php72w-mysql yum install php-mysql yum install php-mysqli this command solved the error yum install ea-php*-mysql* 0 -
Extremely old versions of WordPress rely on the mysql_connect() function in PHP. mysql_connect() was deprecated in PHP 5.5 and removed in PHP 7.0. If the user is using PHP 7.0+ and using a script that relies on mysql_connect() then it won't work. Older versions of WordPress that rely on mysql_connect() generate this particular error message verbatim when run on a PHP 7.0+ system.
@sparek-3 thanks, I thought this could be the only likely relationship between MySQL and WordPress, and I had considered this, initially, but OP states that versions with PHP 7.0 and PHP 7.1 did not have this problem, therefore this issue was to do with the PHP version installed rather than the system running on the PHP. Cheers0 -
Hello @audrey, Can you try installing the mysqlnd RPM for each PHP version you are using to see if it helps solve the issue? EX: yum install ea-php56-php-mysqlnd yum install ea-php70-php-mysqlnd yum install ea-php72-php-mysqlnd
Thank you.0 -
Hi Michael Thanks for your help. As posted above (there is so much other info it is easy to miss) I was able to solve the error using the this command yum install ea-php*-mysql* So need to try your suggestions - but- I will keep the yum commands that you provided in my files if I need them in the future Take care Audrey 0 -
I was able to solve the error using the this command yum install ea-php*-mysql* So need to try your suggestions - but- I will keep the yum commands that you provided in my files if I need them in the future
Hello @audrey, The wildcards (*) in the command you used would have installed the ea-php$$-php-mysqlnd packages. I'm glad to see the issue is now solved. Thanks for sharing the outcome.0
Please sign in to leave a comment.
Comments
12 comments