• Resolved adanguswp

    (@adanguswp)


    I run several WordPress sites on one CentOS 6.9 virtual private server. Each one that I have upgraded to BulletProof Sec v2.2 goes fatal. As soon as I run the autoconfig script and navigate away from that page, I get the “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” indication. I can run the classic info.php script from the affected site and get a perfectly normal response. Sites that haven’t been upgraded continue to run just fine. WHM and cPanel on the server seem to show no issues whatsoever with MySQL.

    I have scanned through the global php.ini, the local .user.ini and .htaccess files to see if anything seems amiss; but nothing obvious pops out at me. The config file runs PHP v5.5 and the servers is configured for that and other versions up to v7.1. MySQL is actually running Maria 10.

    I have restarted Apache and rebooted the server a few times, with no difference.

    The sites also run Wordfence and Better WP Security plugins; but they’ve been configured like this together for several years now without any previous conflicts. The sites in question run different themes, all from Elegant Themes. Again, those have been stable for years.

    The trigger seems to be running the configuration process immediately after the upgrade to v2.2.

    Any thoughts?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author AITpro

    (@aitpro)

    When I google that error message I am finding things like either you are missing PHP handler htaccess code in your Root htaccess file or your php.ini file has an old directive that needs to be commented out or that mysql is being used over mysqli somewhere.

    Most likely what happened is this scenario: You changed your PHP version in your web host control panel at some point, PHP handler code was added directly to your Root htaccess file, but was never added/saved in BPS Custom Code and then when you reran the Setup Wizard (AutoFix) your PHP handler code was not created in your Root htaccess file since it was not saved to BPS Custom Code (1. CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE text box). So the first thing you need to check is if your web host uses PHP handler htaccess code. If so, then copy your web host’s php handler htaccess code for the PHP version that you are using, save that PHP handler code in this Custom Code text box: 1. CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE, click the Save Root Custom Code button and activate Root folder BulletProof Mode.

    https://stackoverflow.com/questions/17694568/php-your-php-installation-appears-to-be-missing-the-mysql-extension-which-is-r

    Plugin Author AITpro

    (@aitpro)

    This info was in the StackOverflow link that I posted above. What is very strange to me about this Wordfence code is that PHP handler code is Not “one size fits all”. In other words this PHP handler code probably would not work on a lot of web hosts worldwide and would most likely crash a website/server.

    If you have Wordfence plugin installed I found commenting out the suPHP_ConfigPath lines in the .htaccess file brought the website back to life:

    # Wordfence WAF
    #<IfModule mod_suphp.c>
    # suPHP_ConfigPath ‘/home/a1614947/public_html’
    #</IfModule>
    I’ve reported this to Wordfence too.

    • This reply was modified 7 years, 8 months ago by AITpro.
    Thread Starter adanguswp

    (@adanguswp)

    I looked through all of the stack overflow material and that didn’t seem to do much.

    However, commenting out the Wordfence firewall suPHP config check in .htaccess did the trick. I’m not sure what’s going on there. Installing WAF does put a small code snippet into the .user.ini file in ~/public_html; but why exactly that would trigger a false detection of missing MySQL is a touch weird.

    Anyway, thanks for this.

    Plugin Author AITpro

    (@aitpro)

    htaccess files are distributed server configuration files and PHP handler htaccess directives/code instruct your server on how to process things – php code, etc. I looked around and it looks like Wordfence adds/creates that generic PHP handler htaccess code on all/any websites. I am very suprised that Wordfence would create such generic php handler htaccess code in the first place. Doing that is potentially a disaster on a massive scale for website owners since PHP handler htaccess code is Not a “one size fits all” kind of thing whatsoever. There are around 350,000 web hosts worldwide and there are probably 1,000 unique PHP handlers for all of those different web hosts. Also it appears that Wordfence is not be aware that some web hosts ignore the Apache IfModule conditions. So using the <IfModule mod_suphp.c> condition which means to only load/process the PHP handler htaccess code if the mod_suphp module is loaded on the server will not work and the PHP handler htaccess code will be processed, which can result in a variety of problems such as server crashes and other strange things because you are instructing your server to do something it should not be doing.

    • This reply was modified 7 years, 8 months ago by AITpro.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘MySQL extension goes “missing”’ is closed to new replies.