Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting include_path for multiple virtual hosts.

Status
Not open for further replies.

flugh

Technical User
Aug 23, 2002
655
US
Greetings,

I have a few virtual hosts on my Mandrake 9.1 box (apache 2.0.47, php 4.3.1). I was wondering about a nice way to set include_path for each vhost. I came up with setting it via
Code:
require_once($_SERVER['Document_Root'] . "/../config.php");
(doing an ini_set() there) but was wondering about other possible solutions. Is there a 'right' way to do this, setting a php config variable on a per-host basis? I want to have each vhost have their own <whatever>include/ directory outside of their web doc tree.

Thanks for any suggestions.

----
JBR
 
The best I can offer is adding the outside folder to the correct include path directive in php.ini. But that's a common area that doesn't provide unique subfolders per vhost.

Do you trust the vhosts?! ;-)

Surfinbox.com Business Internet Services - National Dialup, DSL, T-1 and more.
 
Absolutely NOT! ;-)

Actually, I'm the only one working on the server. I was just looking for a 'someday if I add more' solution now, plus trying to keep security tightened up by minimizing different accounts' privilege needs. I thought there might be some cheat to -Ddefine it with apache on the commandline, or maybe a regex in php.ini (/var/ The method I came up with using DOCUMENT_ROOT seems to work well enough. Maybe some magic with parsing out the domain from $_SERVER['HOSTNAME '] (or whatever that one is called) and appending '/include' to it with ini_set() in a prepended file...

Thanks for the response! :)

----
JBR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top