PHPRC is a replacement for php.ini, ... The sites seem to tell how to create one.
I think that is something a bit different (regarding creating a "phprc" file - a local PHP config file - something unique to DreamHost AFAIK)?
PHPRC (PHP Runtime Configuration) environment variable is one way to tell PHP where to find the main
php.ini file. It can sometimes be used to change the location of the main
On some hosts, the
PHPRC environment variable can also be used to set a local (per site)
php.ini PHP config file. (Otherwise, trying to change the location of
php.ini on a shared host will not do anything, apart from setting the environment variable.) This can also be achieved using a local
.user.ini file and/or
.htaccess - but this can vary from host to host.
The Apache directive
SetEnv (part of
mod_env) simply sets this environment variable.
PHPRC is then available to any scripting language that reads these environment variables.
Why is this required for NinjaFirewall?
The NinjaFirewall docs state:
Installation... NinjaFirewall will need to add some instructions to your system files (php.ini, .htaccess). In most cases, it will be able to detect your configuration and to make those changes for you
My guess is that NinjaFirewall needs a local (
php.ini in your case) config file in which to make changes. Or, less likely, needs the
PHPRC env var set in order to be able find the location of the
php.ini file, which can then be edited. (The specific path that is being set will tell you this... is it a path within your webspace? Or somewhere else on the file system?)
It's also stated in this WordPress.org thread, that:
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.
Although that doesn't seem make much sense to me? (If
php.ini is not "recursive", then I don't think you would be using
php.ini to begin with?)