Changes to php.ini
PHP reads php.ini files to set various properties. In general, PHP 5.3 is much more restrictive than PHP 5.2.14 (the current production version of PHP). If PHP 5.3 is run in default mode, many applications would fail to function properly.
In an attempt to minimize the differences between PHP 5.2.14 and PHP 5.3, a global php.ini file has been developed to allow PHP 5.3 to more or less mimic PHP 5.2.14 behavior.
How php.ini works
The global file is available at /usr/local/php5.3/php.ini
This global php.ini file is read first, followed by php.ini files in individual accounts which override the global settings. You may adjust your individual php.ini files. NOTE: Placing php.ini files in a directory only affects that directory, unless you use .htaccess to specify which php.ini to use (see below).
Using PHPRC
A few accounts use a .htaccess file to define PHPRC – an environment variable that points to the php.ini file that should be used in place of the global php.ini file. For example:
SetEnv PHPRC /ip/my_account/location/php.ini |
The end result with PHP 5.3 is that the global php.ini is not read – only the one defined in the .htaccess file via PHPRC. This may cause applications to fail due to the more restrictive defaults set in PHP 5.3. The solution is to change .htaccess files from using PHPRC to PHP_INI_SCAN_DIR. For example:
SetEnv PHP_INI_SCAN_DIR /ip/my_account/location/php.ini |
This change results in the global php.ini file being read first, and then being overwritten with the values defined for the php.ini in PHP_INI_SCAN_DIR.
PHPRC Finder Utility
A utility has been developed that account owners can use to discover if they have .htaccess files that define PHPRC. Simply login to Webserve and type:
find_phprc |