• Resolved merrydown

    (@merrydown)


    Hi,

    I am having a real headache installing this plugin on one of the domains on a plesk server 12.0.18 (php v5.3.3-40.el6_6) which runs as fastCGI.

    I have tried php.ini .user.ini and php5.ini placed manually and automatically and all of them result in an error about the firewall not being loaded.

    I have tried putting it into the field for extra php directives within plesk ui etc, which gives me a blank page with no error. The error logs for the site show two errors:

    —-
    mod_fcgid: stderr: PHP Notice: session_start(): ps_files_cleanup_dir: opendir(/var/lib/php/session) failed: Permission denied (13) in /var/www/vhosts/sitename.info/httpdocs/wp-content/plugins/ninjafirewall/lib/firewall.php on line 253

    (AND AFTER AN UNINSTALL)
    mod_fcgid: stderr: PHP Warning: Invalid argument supplied for foreach() in /var/www/vhosts/sitename.info/httpdocs/wp-content/plugins/ninjafirewall/uninstall.php on line 86, referer: https://www.sitename.info/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=ninjafirewall%2Fninjafirewall.php&plugin_status=all&paged=1&s&_wpnonce=536ab05b77
    —-

    I have run the ninjacheck file which shows the firewall isn’t being loaded for it either.

    Weirdly I seemed to install it correctly quite quickly previously, though the log didn’t populate after a while.

    After the upgrade today it won’t work at all. I have tried everything on the troubleshooting page to the best of my ability without success.

    I also run wordfence – I wondered if for some reason the updated version conflicted with it, though I don’t think it would. The problem occurs whether or not the wordfence plugin is active.

    Could you offer any advice as to what to try next please?

    Thanks,

    Jim

    https://www.ads-software.com/plugins/ninjafirewall/

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

    (@nintechnet)

    Hi,

    It seems to me that you cannot use PHP INI in the document root folder in Plesk 12 but that you need to use “/var/www/vhosts/system/YOUR_DOMAIN.TLD/etc/php.ini” instead.

    1. run the installer.
    2. select Apache + CGI.
    3. scroll down and select “I want to make the changes myself”.
    4. copy the instructions and paste them into “/var/www/vhosts/system/YOUR_DOMAIN.TLD/etc/php.ini”
    5. finish the installation.

    Thread Starter merrydown

    (@merrydown)

    Hi,

    Thanks for getting back to me. I did so (as I tried before). It errors:

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

    Any other ideas?

    Kind regards,

    Jim

    Plugin Author nintechnet

    (@nintechnet)

    Hi,

    I think I found the problem: PHP 5.3 does not support the PHP header_register_callback() function. That is why you get the blank screen (PHP error).
    I made a small change to the firewall script and forgot about that.
    PHP 5.3 reached end of life last year but still many sites are using it.

    I will patch the firewall.php script today.
    In the meantime you can try to comment out (or delete) lines 82 to 86:

    // Response headers hook :
    if (! empty($nfw_['nfw_options']['response_headers']) ) {
    	define('NFW_RESHEADERS', $nfw_['nfw_options']['response_headers']);
    	@header_register_callback('nfw_response_headers');
    }

    Then try to install it again and use Plesk UI to add the directives.

    Thread Starter merrydown

    (@merrydown)

    Thanks nintechnet.

    That got it working. I am convinced that it is responsible for thwarting the admin-ajax based attacks I have been suffering lately, so thanks very much for fixing it for me!

    Kind regards,

    Jim

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problem installing on FastCgi Plesk Domain’ is closed to new replies.