Specific instructions on how to add php.ini for multiple sites on one account
-
I have an account on Siteground with multiple sites on my account. I found it easy to follow the step-by-step instructions on “Web Application Firewall Setup” for one site: “SiteGround and other hosts without .user.ini support.” But I’m not so clear on how to make it work for multiple sites from the instructions quoted below.
To get to each site’s subdirectory to add the code given: “SetEnv PHPRC /home/user/public_html/sitename/php.ini“, do I go to File Manager, then “Document Root for example.com”? I see “.htaccess” in there. Right-clicking on that gives me a number of choices, including “Edit” and “Code Edit.” Do I choose one of those? Also, how do I adjust the path for the site and the site’s directory name, before adding the code to the .htaccess file?
If you have multiple sites on a single hosting account and need to use php.ini like in the cases above, you may need to add a similar php.ini file for each additional site, in each site’s subdirectory. In this case, you may also need to add code like this in each additional site’s .htaccess file, to tell PHP which php.ini file to use:
SetEnv PHPRC /home/user/public_html/sitename/php.ini
You will need to adjust the path for your site and the site’s directory name, before adding this to the .htaccess file. If the subdirectory site’s .htaccess file already has a similar line, this change may not be needed.Note: Some hosts may require PHPRC to show the path without “php.ini” at the end.
- The topic ‘Specific instructions on how to add php.ini for multiple sites on one account’ is closed to new replies.