[ Copied from ]
http://www.htaccesselite.com/r/php-cgi-vs-mod-php-vt58.html
____________________
|| Custom php.ini ||
=====================================================================
1) When php run as Apache Module (mod_php):
-----------------------
| in root .htaccess |
+------------------------------------------------------------------+
| |
| SetEnv PHPRC /location/todir/containing/phpinifile
| |
+------------------------------------------------------------------+
[ Detailed Directions ]
http://www.htaccesselite.com/r/multiple-custom-php-ini-vt25.html
:
:
:
:
2) When php run as CGI
[*] Place your php.ini file in the dir of your cgi'd php, in this case /cgi-bin/
[*] htaccess might look something like this
-----------------------
| in root .htaccess |
+----------------------------------------------------------------+
| |
| AddHandler php-cgi .php .htm
| |
| Action php-cgi /cgi-bin/php5.cgi
| |
+----------------------------------------------------------------+
:
:
:
:
3) When cgi'd php is run with wrapper (for FastCGI)
[*] You will have a shell wrapper script like this
-------------------
| php-wrap.fcgi |
+----------------------------------------------------------------+
| |
| #!/bin/sh
| |
| export PHP_FCGI_CHILDREN=3
| |
| exec /user3/x.com/htdocs/cgi-bin/php5.cgi
| |
+----------------------------------------------------------------+
[*] Change To
-------------------
| php-wrap.fcgi |
+----------------------------------------------------------------+
| |
| #!/bin/sh
| |
| export PHP_FCGI_CHILDREN=3
| |
| exec /x.com/cgi-bin/php.cgi -c /abs/path/to/php.ini
| |
+----------------------------------------------------------------+
:
:
:
: