Support » Plugin: NinjaFirewall (WP Edition) - Advanced Security » not working with php 73

  • Resolved alex845



    After I upgraded to php73, I receive the following error:

    Fatal error: Uncaught Error: Class ‘mysqli’ not found in /home/xxx/public_html/wp-content/plugins/ninjafirewall/lib/firewall.php:126 Stack trace: #0 /home/xxx/public_html/wp-content/nfwlog/ninjafirewall.php(7): include() #1 {main} thrown in /home/xxx/public_html/wp-content/plugins/ninjafirewall/lib/firewall.php on line 126

    Unfortunately, support for mysqli seems to be dropped in php73…

    It works fine in 7.2, but if I disable mysqli over there, I will see the same error as above.

    Any ideas?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author nintechnet



    NinjaFirewall works with 7.3, and PHP did not drop support for Mysqli. (most web applications would crash otherwise!)
    When upgrading PHP, make sure to upgrade all its module as well. In that case, you likely forget at least the mysqli module.

    Debian & al.
    # apt-get install php7.0-mysql

    Red Hat & al.
    # yum install php-mysqli

    To view all your PHP modules that are installed:
    # php -m

    Thanks for the quick reply.

    I forwarded this to my hosting provider who takes care this stuff

    …and my webhost clearly does not agree, here is what they say:

    Hi there,

    PHP 7.3 doesn’t support mysqli but it is under nd_mysqli, I’d recommend updating your code to be compatible with 7.3.

    Sean L

    Don’t know what to think about it…

    • This reply was modified 3 months, 1 week ago by  alex845.
    Plugin Author nintechnet


    I still don’t understand why the code does not work on your server and also why your host suggests to change it.
    Can you run this script on your server and paste the results here:

    echo "<h3>Declared classes:</h3>";
    $res = get_declared_classes();
    foreach( $res as $class ) {
       if ( stripos( $class, 'mysql' ) !== false ) {
          echo "$class<br />";

    Run it twice: once with PHP 7.2 and then once with PHP 7.3

    Thanks for the code.

    With php72:

    Declared classes:

    With php 73:

    On my wp site: a 500 error

    On a subdomain where I installed Matomo

    Declared classes:

    (nothing here)

    Unlikely that it is related, but my Matomo server gives the following error in php73

    Matomo requires the php5-json extension which provides the functions json_encode() and json_decode()

    Seems my host will have some work over there too 😉

    Plugin Author nintechnet


    You will need the json extension, so it looks like you have some missing modules.

    Try this last test with PHP 7.3:
    1. Download
    2. Rename this file to “wp-db.php”.
    3. Upload it into your WordPress root folder.
    4. Go to http://YOURWEBSITE/wp-db.php
    5. Delete it afterwards.

    The same story: in debug mode I see only the ‘no mysqli 500 error’

    In 7.2 everything seems to be normal (read and connect to wp-config & database).

    Plugin Author nintechnet


    I would stick to 7.2, your 7.3 version has some issues that you would need to solve.

    I would stick to 7.2, your 7.3 version has some issues that you would need to solve.

    … or move to another host if they continue to treat their customers as idiots…

    I just installed a fresh copy op WP on a subdomain – just WP, no plugins – and guess what happened if I switch to 7.3?

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

    Looks clear for me, obviously nothing wrong with Ninja Firewall 😉

    Thanks for your help!

    • This reply was modified 3 months, 1 week ago by  alex845.
Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.