PEAR and Virtual Hosts

From: Date: Tue, 02 Nov 2004 17:04:37 +0000
Subject: PEAR and Virtual Hosts
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-15300@lists.php.net to get a copy of this message
Greetings. A newbie question, if you will. I've got several FreeBSD servers that use Virtual Hosts for the various clients hosted on those servers. Each of the virtual hosts are set up like this: <VirtualHost XXX.XXX.XXX.XXX> ServerAdmin webmaster@website.com DocumentRoot /home/www/website.com ServerName website.com ServerAlias www.website.com php_admin_value doc_root /home/www/website.com php_admin_value open_basedir /home/www/website.com php_value include_path .:/home/www/website.com/includes php_value auto_prepend_file header.inc.php php_value auto_append_file footer.inc.php ErrorDocument 404 http://www.website.com </VirtualHost> Each of the virtual hosts like this in the httpd.conf file has its own include path because each of the client's needs are different and in some cases *need* to be isolated from each other. The base directory is, of course, to make sure each has their own playground. The problem comes in where when I want to use a PEAR library (installed in /usr/local/lib/php). Even if I add the appropriate directory to the include path, the open_basedir screams violation. I also tried creating a symbolic link within the includes directory to the PEAR includes directory but that didn't fool the open_basedir rule and it screamed again about trying to open a file outside of its own "playground". Now I've got to assume there are others out there with virtual hosts configurations that would like to use PEAR so I'm looking for suggestions on how to get this to work. I was able to get things to work by removing the open_basedir rule and adding the PEAR directory to the include path, but I do feel there must be a more secure way of doing this. Not to mention I wouldn't look forward to doing this to every virtual host entry on all of our servers. Thanks for your time. - Nickolas Burger

« previous php.pear.general (#15300) next »