note 76362 added to configuration.changes
| From: | webmaster at htaccesselite dot com | Date: | Thu, 12 Jul 2007 03:18:14 +0000 |
| Subject: | note 76362 added to configuration.changes | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128397@lists.php.net to get a copy of this message | ||
To change the configuration for php running as cgi those handy module commands won't work.. The
work-around is being able to tell php to start with a custom php.ini file.. configured the way you
want.
With multiple custom php.ini files
-------------------------------------------
/site/ini/1/php.ini
/site/ini/2/php.ini
/site/ini/3/php.ini
--
The trick is creating a wrapper script to set the location of the php.ini file that php will use.
Then it exec's the php cgi.
shell script /cgi-bin/phpini.cgi
-------------------------------------------
#!/bin/sh
export PHPRC=/site/ini/1
exec /cgi-bin/php5.cgi
--
Now all you have to do is setup Apache to run php files through the wrapper script instead of just
executing the php cgi.
In your .htaccess or httpd.conf file
-------------------------------------------
AddHandler php-cgi .php
Action php-cgi /cgi-bin/phpini.cgi
--
So to change the configuration of php you just need to change the PHPRC variable to point to a
different directory containing your customized php.ini.. You could also create multiple shell
wrapper scripts and create multiple Handler's+Actions in .htaccess..
in your .htaccess
-------------------------------------------
AddHandler php-cgi1 .php1
Action php-cgi1 /cgi-bin/phpini-1.cgi
AddHandler php-cgi2 .php2
Action php-cgi2 /cgi-bin/phpini-2.cgi
AddHandler php-cgi3 .php3
Action php-cgi3 /cgi-bin/phpini-3.cgi
--
The only caveat here is that it seems like you would have to rename the file extensions, but there
are ways around that too ->
http://www.askapache.com/php/custom-phpini-tips-and-tricks.html
----
Server IP: 69.147.83.197
Probable Submitter: 62.75.162.71
----
Manual Page -- http://www.php.net/manual/en/configuration.changes.php
Edit -- https://master.php.net/note/edit/76362
Del: integrated -- https://master.php.net/note/delete/76362/integrated
Del: useless -- https://master.php.net/note/delete/76362/useless
Del: bad code -- https://master.php.net/note/delete/76362/bad+code
Del: spam -- https://master.php.net/note/delete/76362/spam
Del: non-english -- https://master.php.net/note/delete/76362/non-english
Del: in docs -- https://master.php.net/note/delete/76362/in+docs
Del: other reasons-- https://master.php.net/note/delete/76362
Reject -- https://master.php.net/note/reject/76362
Search -- https://master.php.net/manage/user-notes.php