Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED PHP installation appears to be missing the MySQL extension

Discussion in 'EasyApache' started by audrey, Apr 18, 2019.

  1. audrey

    audrey Well-Known Member

    Joined:
    Oct 18, 2006
    Messages:
    84
    Likes Received:
    2
    Trophy Points:
    158
    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
     
  2. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,923
    Likes Received:
    177
    Trophy Points:
    343
    cPanel Access Level:
    Root Administrator
    What version of WordPress are you using?
     
  3. martin MHC

    martin MHC Well-Known Member

    Joined:
    Sep 14, 2016
    Messages:
    151
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    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 EA4 documentation for how to use it, basically you have a bunch of options and you simply need to update your choices and add the MySQL options.


    Another option is to install MySQL via YUM and you can do that via the MySQL documentation. Yum is available from the WHM Terminal or SSH on your server.
     
  4. audrey

    audrey Well-Known Member

    Joined:
    Oct 18, 2006
    Messages:
    84
    Likes Received:
    2
    Trophy Points:
    158
    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
     
  5. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,923
    Likes Received:
    177
    Trophy Points:
    343
    cPanel Access Level:
    Root Administrator
    I beg to differ... but OK.
     
  6. martin MHC

    martin MHC Well-Known Member

    Joined:
    Sep 14, 2016
    Messages:
    151
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    With respect, please can you explain how WordPress versions effect MySQL installs? Thanks.
     
  7. martin MHC

    martin MHC Well-Known Member

    Joined:
    Sep 14, 2016
    Messages:
    151
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    I believe this may work;

    However, I have found

    Code:
    yum install php-mysql
    and

    Code:
    yum install php-mysqli
    Both of these should possibly be run before trying more specific modules.

    source serverfault.com/a/874365
     
    #7 martin MHC, Apr 18, 2019
    Last edited by a moderator: Apr 18, 2019
  8. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,923
    Likes Received:
    177
    Trophy Points:
    343
    cPanel Access Level:
    Root Administrator
    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.
     
  9. audrey

    audrey Well-Known Member

    Joined:
    Oct 18, 2006
    Messages:
    84
    Likes Received:
    2
    Trophy Points:
    158
    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*
     
  10. martin MHC

    martin MHC Well-Known Member

    Joined:
    Sep 14, 2016
    Messages:
    151
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    @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
     
  11. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,534
    Likes Received:
    2,182
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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:

    Code:
    yum install ea-php56-php-mysqlnd
    yum install ea-php70-php-mysqlnd
    yum install ea-php72-php-mysqlnd
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. audrey

    audrey Well-Known Member

    Joined:
    Oct 18, 2006
    Messages:
    84
    Likes Received:
    2
    Trophy Points:
    158
    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
     
  13. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,534
    Likes Received:
    2,182
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice