In your home directory you need to create (if you don’t already have it) a php-fastcgi folder. Within this folder create two files (php5-fcgi and php4-fcgi) with the following contents:
php5-fcgi
#!/bin/sh
PHPRC="/usr/local/etc"
export PHPRC
exec /usr/local/www/cgi-bin/php5-fcgi
php4-fcgi
#!/bin/sh
PHPRC="/usr/local/etc/php4"
export PHPRC
exec /usr/local/www/cgi-bin/php4-fcgi
The line PHPRC="/usr/local/etc" in each file is the folder that is scanned for a php.ini file.
So, if you want your own php.ini, do the following via a shell account or SFTP (and substitute all instances of yourusername with your user name):
- Create a php4 folder: /user/home/yourusername/etc/php4
- Download the php4.ini file here, rename it to
php.iniand upload it to the new folder: /users/home/yourusername/etc/php4 - Create a php5 folder yourusername/etc/php5
- Download the php5.ini file here, rename it to
php.iniand upload it to the new folder: /users/home/yourusername/etc/php5 - Make php-fastcgi/php4-fcgi writeable by you (rwx-r-x-x or chmod 751)
- Make php-fastcgi/php5-fcgi writeable by you (rwx-r-x-x or chmod 751)
- For php4-fcgi, change PHPRC="/usr/local/etc/php4" to PHPRC="/home/yourusername/etc/php4" and save.
- For php5-fcgi, change the PHPRC="/usr/local/etc" to PHPRC="/home/yourusername/etc/php5" and save
Note: When creating these files make sure they have the appropriate permissions (which would be 751 since they need to be executable) and that they don't contain any DOS line endings (CRLF). Line endings or line breaks are usually a option you can set in your text editor of choice. The preferred option is Unix line endings (LF).
So you now have a custom php.ini file for your account that you can use to change some common settings.
Note: Your account, by default, will run under PHP 5, so you should only need to adjust any settings in /users/home/yourusername/etc/php5/php.ini unless you've switched to PHP 4
To change error reporting, modify the following lines in your php.ini file:
error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
display_errors = Off
to
#error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
#display_errors = Off
error_reporting = E_ALL
display_errors = On
Note: The above applies to your primary domain only. If you want a custom php.ini to work with your other domains as well, you need to repeat the above for each of your domains (the ‘home directory’ referenced above will of course become the directory of the particular domain). If you want to have a single custom php.ini, just point all PHPRC variables to the same location.
