PHP7 + PHP-FPM
-
I’m looking at upgrading a number of WP site to use PHP7 and possibly PHP-FPM.
Are there any issues or actions I need to take into consideration for NF?
Thanks in advance.
-
Hi,
You can check this article: Upgrading to PHP 7 with NinjaFirewall installed.
As indicated, if you are using aphp.inifile, you will likely need to rename it to.user.ini.Recently upgraded to php-fpm and I get a notice in all sites “NinjaFirewall fatal error: Unable to communicate with the firewall. Please check your PHP INI settings. Review your installation, your site is not protected.”.
So I go through the steps in the plugin to set it up but it doesn’t put anything in the htaccess so the site knows where the user.ini file is.
Uploaded wp-check.php and it said in red “php.ini found – .user.ini found – Warning: you have more than one INI file”.
Is this my issue? I’ve always used user.ini, never really used the php.ini until upgrading to php 7.
So I re-ran the setup steps and selected php.ini. It put the code into the php.ini file. I removed the user.ini. Plugin still says “Error: the firewall is not loaded.”. Same thing after restarting apache.
Hi
With your configuration, you would probably need to use
.user.iniand, after adding NinjaFirewall’s directive to it, to restart PHP-FPM:
In Debian (incl. Ubuntu, Mint etc):# service php7.0-fpm restartor# service php7.0-fpm restart.
In RedHat (incl. CentOS):# /etc/init.d/php-fpm restartor# service php-fpm restart
Usingreloadinstead ofrestartwill work too.Selected user.ini, restarted php/apache and I see “Error: the firewall is not loaded.”.
Cpanel was updated to version 60, before this all the sites’ ninjafiewall worked. Now after version 60, php-fpm was available so it was turned on for the sites. They’re much faster now, but the plugin stoped working on them all. Thats all thats changed.
-
This reply was modified 9 years, 5 months ago by
jgjh151.
Can you contact cPanel and ask them why PHP INI files stopped working after the update to v60? I assume it is just a small configuration problem.
Seems with cpanel php-fpm the php.ini file in the domain directory is ignored and you have to place the items from the php.ini into the domain’s fpm config file.
https://forums.cpanel.net/threads/php-fpm-and-php-ini.582382/
Does NinjaFirewall work now?
I’m not messing with the php-fpm config files to get this working, so no, not working at this point.
Weird thing is all the sites also started sending “[NinjaFirewall] Security rules update” AND “NinjaFirewall] Daily Activity Report” even though when I go to those sites to again turn off the notifications I can’t because it says “Error: the firewall is not loaded.”.
Cpanel thread if interested: https://forums.cpanel.net/threads/php-fpm-and-php-ini.582382
Weird thing is all the sites also started sending “[NinjaFirewall] Security rules update” AND “NinjaFirewall] Daily Activity Report”
That’s normal, the plugin is enabled. Disable it from the “Plugins” page to stop notifications.
@jgjh151 thanks for posting the Cpanel thread… did you solve it?
-
This reply was modified 9 years, 5 months ago by
The topic ‘PHP7 + PHP-FPM’ is closed to new replies.