Page 1 of 1

A php.ini problem.. Several domains

Posted: Fri Jan 17, 2003 3:47 am
by Kenshi
Hello all,

I have a minor problem with my server and PHP. I hope some of you guys can help or perhaps hint at a solution. :)

On my server (SME, http://www.e-smith.org) I have 4 domains. 1 is my own, the rest belongs to other people. What I need is a way to have different php.ini settings for different domains. Basically I need the following settings.

For mydomain.bla:
file_uploads=On
upload_tmp_dir=/home/e-smith/blabla/mydomainpath
upload_max_filesize=10M

For domain otherdomain1.bla:
file_uploads=off
;upload_tmp_dir=
;upload_max_filesize=

For domain otherdomain2.bla:
file_uploads=On
upload_tmp_dir=/home/e-smith/blabla/otherdomain2path
upload_max_filesize=1M

For domain otherdomain3.bla:
file_uploads=On
upload_tmp_dir=/home/e-smith/blabla/otherdomain3path
upload_max_filesize=5M

Is this possible in any way?

Regards
Thomas L.

Posted: Fri Jan 17, 2003 3:59 am
by twigletmac
Which web server are you using?

Mac

Posted: Fri Jan 17, 2003 4:02 am
by Kenshi
Apache.. :)

My server is running the SME Server software. You can read more about it here.

Regards
Thomas L.

Posted: Fri Jan 17, 2003 4:43 am
by volka
http://www.php.net/manual/en/configurat ... [quote]The default location of php.ini is a compile time option (see the FAQ entry), but can be changed for the CGI and CLI version with the -c command line switch, see the chapter about using PHP from the command line. You can also use the environment variable PHPRC for an additional path to search for a php.ini file.[/quote]this can be done in your httpd.conf (may be even in .htaccess). See also: http://httpd.apache.org/docs/env.html#setting

You can change (some) ini-settings on a per-directory base by setting them in your .htaccess file. See also: http://www.php.net/manual/en/configuration.changes.php

Posted: Fri Jan 17, 2003 6:37 am
by Kenshi
volka wrote:http://www.php.net/manual/en/configurat ... [quote]The default location of php.ini is a compile time option (see the FAQ entry), but can be changed for the CGI and CLI version with the -c command line switch, see the chapter about using PHP from the command line. You can also use the environment variable PHPRC for an additional path to search for a php.ini file.
this can be done in your httpd.conf (may be even in .htaccess). See also: http://httpd.apache.org/docs/env.html#setting

You can change (some) ini-settings on a per-directory base by setting them in your .htaccess file. See also: http://www.php.net/manual/en/configuration.changes.php[/quote]

Thanks Volka..

I'm tho having a wee bit of problems understanding how to do this. I've read the links, but none of them seems to mention the exact syntax for changing these 3 settings.

Man, I feel like such a newbie.. :?

I will read 'em again... :)

Posted: Fri Jan 17, 2003 6:42 am
by Kenshi
Is this correct:

php_value file_uploads=On
php_value upload_tmp_dir=/home/e-smith/blabla/mydomainpath
php_value upload_max_filesize=10M

I assume this should be put in the virtual domain part of my httpd.conf...

Is it really that "easy"?

Posted: Fri Jan 17, 2003 6:50 am
by volka
without the equation-signs.
There are examples at http://www.php.net/manual/en/configuration.changes.php ;)

Posted: Fri Jan 17, 2003 6:57 am
by Kenshi
volka wrote:without the equation-signs.
There are examples at http://www.php.net/manual/en/configuration.changes.php ;)
Got it!

Thanks man.. Awesome.. :D

Looking forward to test it out!