Can open_basedir be specified as an argument?

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
toasty2
Forum Contributor
Posts: 361
Joined: Wed Aug 03, 2005 10:28 am
Location: Arkansas, USA

Can open_basedir be specified as an argument?

Post by toasty2 »

I am wanting to use 1 PHP installation for my server but I have several virtual hosts each with their own directories. I want each host to only be able to access inside it's directory...open_basedir is what I want to use. Can I specify open_basedir when launching the PHP interpreter for each virtual host? I would prefer that over creating a .ini file for each host and using -c "path/to/host.ini".

If anyone is curious, no I do not use Apache and PHP as a module. I use PHP in FastCGI with Abyss Web Server.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Can open_basedir be specified as an argument?

Post by Weirdan »

-d open_basedir=/path/to/vhost/dir

In this way you may specify (and override) any option from php.ini
toasty2
Forum Contributor
Posts: 361
Joined: Wed Aug 03, 2005 10:28 am
Location: Arkansas, USA

Re: Can open_basedir be specified as an argument?

Post by toasty2 »

Thanks, it works.
Post Reply