Overiding PHP.ini Settings
From SuperbHosting.net Support Wiki
Overriding PHP.ini Settings
When using a Shared Hosting plan, often times there will be some sort of forum, bulletin board, or other PHP web application that requires specific changes to the PHP configuration variables. This PHP.ini directives list gives a comprehensive view of all available PHP configuration directives, and whether or not they can be overridden in a user's local directory. If the directive the customer wants to override is listed as 'PHP_INI_ALL' or 'PHP_INI_PERDIR', see below on how to perform the override.
Unix
Unix systems are particularly simple:
- Create a .htaccess file in the directory the web app will live in
- Add the directives just as you would in the PHP.ini file, prepended with one of the following:
- php_value for non-boolean values (Example: php_value log_error_max_len 1024)
- php_flag for boolean values (Example: php_flag log_error on)
- Save the .htaccess file
Windows
Windows is a bit more difficult due to eccentricities in IIS:
- Create a php.ini file in the user's public_html directory
- Add the directives just as you would in the standard PHP.ini file. No need to prepend anything here.
- Save the php.ini file
- Open the IIS Manager, select Application Pools
- Right click on Default and select 'recycle'. Do the same for PHP.
For both methods, make a quick phpinfo() file to check the local vs. global values of the configuration variables you're changing to make sure everything has gone through.
