Separate php.ini file for each Apache virtual host?
Posted
by Calvin L
on Server Fault
See other posts from Server Fault
or by Calvin L
Published on 2010-05-20T23:29:38Z
Indexed on
2010/05/21
9:21 UTC
Read the original article
Hit count: 377
Is it possible to have a separate php.ini file that overrides the default php.ini file for each virtual host? I'm running Apache/2.2.14, PHP 5.3.2-1.
For example I have several vhosts pointing to domains in my /var/www/
directory:
/var/www/website1.com
/var/www/website2.com
What I'd like is to be able to place a custom php.ini file in each directory that would override the default values only for that vhost, but keep the original defaults if the value isn't specified:
/var/www/website1.com/htdocs/
/var/www/website1.com/php.ini
EDIT: I found more info on the topic here for those interested: http://serverfault.com/questions/34078/how-do-i-set-up-per-site-php-ini-files-on-a-lamp-server-using-namevirtualhosts
© Server Fault or respective owner