First of all, I've looked in the forums, and have not found an answer to this issue.
My specs are as follows:
Platform: Redhat Linux 7.3
Web server: Apache 1.3.213
Virtual server #1 points to /var/www/cart_ssl/
Virtual server #2 (https://my.servername.com) points to /var/www/test_ssl/
Both are declared properly in httpd.conf and work fine now, except for one thing.
I am going to the following page:
https://my.servername.com/store/index.php
This page has an include that is trying to retrieve photos from a directory outside of the document root. This include is called get_photos.inc, and is located in /var/www/test_ssl/include/.
In this include file, I would like to use the following code to read the contents of /var/www/cart_ssl/photos/:
**** begin PHP script ***********
$photo_directory = "../photos/";
if ($handle = opendir($photo_directory)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
[do stuff here]
}
}
closedir($handle);
}
**** end PHP script ***********
Now what I am trying to do is have "../photos" resolve to /var/www/cart_ssl/photos. This is what I am having the problem with.
I have received advice to employ the php_admin_value open_basedir command in httpd.conf with the VirtualHost directive for VS #2, but I am not sure how to set this correctly so I can access the desired folder.
Is there a way that I can get this to work?