Hello scegg,
is there a user.ini file in your root? The code you are seeing in .htaccess is describing where to find a definition for a auto_prepend_file directive that Wordfence uses. This is part of the new Web Application Firewall (WAF) feature that came with Wordfence 6. The purpose of this code is to load the Firewall before any other code is loaded on your site so that it can protect you more efficiently. You can read more about WAF here.
Thread Starter
scegg
(@scegg)
There is no user.ini but a .user.ini.
; Wordfence WAF
auto_prepend_file = ‘/path/to/my/website/root/wordfence-waf.php’
; END Wordfence WAF
But by setting the suphp config path, all setting i’ve set for suphp are overwritten. How to keep my settings? Copy my suphp config file to the website root folder?
Thanks.
Hello scegg,
this is kind of advanced usage so proceed with caution and keep backup of your files so you can revert any changes. What you could do is this:
1. Move the auto_prepend_file directive to your global .ini file (not in the root)
2. Remove suPHP_ConfigPath declaration from .htaccess
Please note that this assumes you control your global .ini files and that they are not used by any other sites but the one for which you are specifying a the path. If you do this with multiple sites using that same .ini file, the other sites will break.
suPHP_ConfigPath is *NOT* required to point to the directory where .user.ini is located for .user.ini to be loaded. All adding it does is cause unneeded problems in exactly this sort of configuration by needlessly overriding whatever default php.ini path has been set up in the server configuration.
Edit: suPHP_ConfigPath only sets where the php.ini file is loaded from (by setting the PHPRC environment variable). .user.ini comes from the directory the script is in or any parent directory up to the document root: http://php.net/manual/en/configuration.file.per-user.php