The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL extension missing

Discussion in 'EasyApache' started by Hany28, Jun 30, 2016.

Tags:
  1. Hany28

    Hany28 Registered

    Joined:
    Aug 1, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    Suddenly I got this message after cpanel update:-

    Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

    I rebuild Apache and php and I'm sure mysql is exist but not sure why sites have this issue!!


    Regards


    Hany
     
  2. grindlay

    grindlay Active Member

    Joined:
    Dec 8, 2004
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Edinburgh, Scotland
    cPanel Access Level:
    Root Administrator
    I have the same issue, but only on one site. I uploaded a phpinfo() file and it seems to confirm that it's missing, but just for that site. Investigations continue..
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you verify if you are using EasyApache 4? If so, note that custom "suPHP_ConfigPath" values in the .htaccess file within an account's document root will prevent the reading of .ini files within /opt/cpanel/ea-php$version/root/etc/php.d/. Thus, the modules enabled in those .ini files are not loaded. Internal case EA-4772 aims to address this issue by disabling the "suPHP_ConfigPath" values in the .htaccess files during the migration to EasyApache 4. The workaround to this issue if you have already migrated to EasyApache 4 is to manually remove the "suPHP_ConfigPath" value in the .htaccess file of the affected account.

    Thank you.
     
  4. cPJacob

    cPJacob cPanel Product Owner
    Staff Member

    Joined:
    May 2, 2014
    Messages:
    510
    Likes Received:
    66
    Trophy Points:
    28
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi,

    Yep, the thing with suPHP_ConfigPath is that it now prevents reading php.d from loading. This allows your users to 100% customize their PHP operating environment and configuration, but it also means that no extra modules are loaded from the global / system PHP. Thus, they need a 100% *full* INI to properly operate. This means they need to load mysqlnd.so or PDO directly in their INI files.

    Another work around to keep them using their local php.ini is to back it up, and give them an EA4 INI:
    Code:
    #[~]cat /opt/cpanel/ea-php70/root/etc/php.ini /opt/cpanel/ea-php70/root/etc/php.d/*.ini > /home/user/public_html/ini
    This will give them a 100% working copy of the global configuration, and they can configure it appropriately through either the UIs inside cPanel or manually via ftp/ssh.

    As Michael stated, we're going to add something to the migration script to comment out suPHP_ConfigPath so sites load, and we'll alert the administrator of the users / document roots they need to fix. We'll also be adding some UI elements in the MultiPHP INI Editor to assist in getting users a 100% clone of the system configuration so they can start in a great place.

    I hope this helps!
     
  5. fuzzylogic

    fuzzylogic Registered

    Joined:
    Nov 8, 2014
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I can add some detail that may help some people with this problem.
    I have this problem on all my WordPress sites.
    I am using EasyApache 4, SuPHP and the WordPress Plugin WordFence's Firewall option.
    WordFence writes a suPHP_ConfigPath to .htaccess when the firewall is enabled.
    Unfortunately without mysql connection the WordPress backend cannot be accessed to disable the firewall.
    If the suPHP_ConfigPath is commented out in the .htaccess file the server returns 500 error for all pages.
    If the # Wordfence WAF block is deleted from the .htaccess then normal server function is restored.
    WordFence firewall should then be disabled from within the WordPress backend.

    I will post this issue to the makers of WordFence once I complete fixing all my sites.
     
  6. grindlay

    grindlay Active Member

    Joined:
    Dec 8, 2004
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Edinburgh, Scotland
    cPanel Access Level:
    Root Administrator
    Thanks for all the replies. Makes sense as I thought I'd removed all my suPHP_config directives but clearly not.
    Also, didn't realise that Wordfence could re-instate them - I use Wordfence on a lot of WP sites.
     
  7. NOC_Serverpoint

    NOC_Serverpoint Active Member

    Joined:
    Jul 3, 2016
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Hello,

    Can you please confirm whether the issue is resolved?

    The default PHP settings are not read to the website's wp settings and that's the root cause of the issue. Was the issue resolved by disabling the suPHP settings for the account?
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, multiple reports of this issue were addressed by the workaround referenced in this thread.

    Thank you.
     
Loading...

Share This Page