A php.ini problem.. Several domains

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Kenshi
Forum Newbie
Posts: 5
Joined: Fri Jan 17, 2003 3:47 am

A php.ini problem.. Several domains

Post 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.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Which web server are you using?

Mac
Kenshi
Forum Newbie
Posts: 5
Joined: Fri Jan 17, 2003 3:47 am

Post by Kenshi »

Apache.. :)

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

Regards
Thomas L.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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
Kenshi
Forum Newbie
Posts: 5
Joined: Fri Jan 17, 2003 3:47 am

Post 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... :)
Kenshi
Forum Newbie
Posts: 5
Joined: Fri Jan 17, 2003 3:47 am

Post 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"?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

without the equation-signs.
There are examples at http://www.php.net/manual/en/configuration.changes.php ;)
Kenshi
Forum Newbie
Posts: 5
Joined: Fri Jan 17, 2003 3:47 am

Post 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!
Post Reply