Skip to main content

PHP installation appears to be missing the MySQL extension

Comments

12 comments

  • sparek-3
    What version of WordPress are you using?
    0
  • martin MHC
    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
  • audrey
    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
  • sparek-3
    Wordpress version is not important.

    I beg to differ... but OK.
    0
  • martin MHC
    I beg to differ... but OK.

    With respect, please can you explain how WordPress versions effect MySQL installs? Thanks.
    0
  • martin MHC
    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 found yum install php-mysql
    and yum install php-mysqli
    Both of these should possibly be run before trying more specific modules. source serverfault.com/a/874365
    0
  • sparek-3
    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
  • audrey
    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
  • martin MHC
    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. Cheers
    0
  • cPanelMichael
    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
  • audrey
    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
  • cPanelMichael
    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.