Support » Plugins » NinjaFirewall installation failed

  • Resolved azw



    I’m having trouble installing NinjaFirewall on WP 4.6 on this site:

    The odd thing is that I have another WordPress site running NinjaFirewall on the same VPS without this problem.

    I’m getting these messages:

    Error: the firewall is not loaded. (after installation)

    NinjaFirewall fatal error: Unable to communicate with the firewall. Please check your PHP INI settings. Review your installation, your site is not protected. (in the dashboard)

    NinjaFirewall (WP edition) troubleshooter

    HTTP server : Apache
    PHP version : 5.4.45

    auto_prepend_file : /home/xx/public_html/wp-content/nfwlog/ninjafirewall.php
    NinjaFirewall detection : NinjaFirewall WP Edition is loaded

    Loaded INI file : /home/xxx/public_html/php.ini
    user_ini.filename : .user.ini
    user_ini.cache_ttl : 300 seconds
    User PHP INI : php.ini found –

    DOCUMENT_ROOT : /home/xxx/public_html
    wp-config.php : found in /home/xxx/public_html/wp-config.php
    ABSPATH : /home/xxx/public_html/
    WordPress version : 4.6
    WP_CONTENT_DIR : /home/xxx/public_html/wp-content
    Plugins directory : /home/xxx/public_html/wp-content/plugins
    User Role : Unknown role (or user not logged in)
    NinjaFirewall (WP edition) troubleshooter v1.2

    I have a php.ini file, updated by NinjaFirewall. I don’t see a .user.ini file in the public_html folder in the remote.

    The .htaccess with and without the following code, but I don’t think there is anything else in it related to NinjaFirewall.

    # BEGIN NinjaFirewall
    <IfModule mod_env.c>
       SetEnv PHPRC /home/arthurwa/public_html/php.ini
    # END NinjaFirewall

    .htaccess also has this code:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

    There is other code in the .htaccess, but the problem persists whether it’s present or not.

    What should I check next?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter azw


    It looks like I misidentified the server type. I should have used suPHP, not CGI-FastCGI. It’s working now!


    As you are running PHP 5.4.45 you could try to use .user.ini instead of php.ini.

    1. Edit your .htaccess and comment out the 3 lines between ‘BEGIN NinjaFirewall’ and ‘END NinjaFirewall’.
    2. Rename your php.ini to .user.ini.

    You may need to wait up to 5 minutes (user_ini.cache_ttl:300 seconds) before PHP reloads the INI file.

    If it works you can ignore my recommendations.

    Thread Starter azw


    Thanks for the reply, Nintechnet!
    I did take the suggestion NinjaFirewall made to use .user.ini.
    Is the .htaccess code simply not needed?
    Best wishes, Art

    The SetEnv PHPRC directive in the .htaccess is only needed when you are using a php.ini that is not recursive, i.e., that does not apply to subdirectories. suPHP requires the suPHP_ConfigPath directive instead.
    It is better to use a .user.ini (if possible), because it is recursive and also because the SetEnv PHPRC directive will likely override all the configuration from the server main PHP INI file and could create some issues.

    You can read more about that in our blog article: Troubleshoot NinjaFirewall installation problems.

    Thread Starter azw


    That’s a very complete answer, Nintechnet. Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘NinjaFirewall installation failed’ is closed to new replies.