Page 1 of 1

different php.ini same server

Posted: Tue Mar 13, 2007 7:43 pm
by bluesman333
Does anyone know how I can have a different php.ini file for different sites on the same server? I know it is possible but I can't find the right documentation on it.

I tried adding PHPIniDir to the VirtualHost directive but when I restarted Apache I got an error that the ini file was already loaded.

phpinfo suggests that the ini file is in C:\WINDOWS but it is not there.

I've removed the PHPRC Environment Variable and do not see any Registry Entries.

Posted: Tue Mar 13, 2007 9:48 pm
by anjanesh
Does adding PHPIniDir to htaccess work ?

Posted: Tue Mar 13, 2007 10:03 pm
by Luke
moved to installation/configuration

Posted: Tue Mar 13, 2007 11:09 pm
by feyd
When run as a module, there is only one php.ini used. If you run it as (Fast)CGI you can choose different php.ini files.

Re: different php.ini same server

Posted: Wed Mar 14, 2007 11:40 am
by mentor
bluesman333 wrote:Does anyone know how I can have a different php.ini file for different sites on the same server?
If you need different .ini values for different sites then you can use .htacces for this. e.g. for one site you want to set upload file size limt 5 MB and for others 10MB. create a file with name ".htaccess" and put the below code for 5MB limit

php_value upload_max_filesize 5M
php_value post_max_size 5M

Similarly you can change other settings too.

Re: different php.ini same server

Posted: Wed Mar 14, 2007 7:38 pm
by bluesman333
mentor wrote:
If you need different .ini values for different sites then you can use .htacces for this. e.g. for one site you want to set upload file size limt 5 MB and for others 10MB. create a file with name ".htaccess" and put the below code for 5MB limit

php_value upload_max_filesize 5M
php_value post_max_size 5M

Similarly you can change other settings too.
Thanks, I'll use that method.