I’m trying to enable a php file to access another file residing in a folder outside the root web directory over an HTTPS connection. This works fine over HTTP but for some reason HTTPS connections are failing to read the file.
I’ve enabled this over HTTP by disabling openbase_dir in a vhost.conf file, as follows:
php_admin_value open_basedir “/var/www/vhosts/my-domain.com/httpdocs:/usr/share/pear:/tmp:/var/www/vhosts/my-domain.com/my_folder/”
php_admin_value open_basedir none
I’ve then tried both appending and replacing the contents of vhost.conf with the following:
php_admin_value open_basedir “/var/www/vhosts/my-domain.com/httpsdocs:/usr/share/pear:/tmp:/var/www/vhosts/my-domain.com/my_folder/”
php_admin_value open_basedir none
However after reconfiguring the server to use the new vhost.conf file and restarting apache, attempts to have the test php file inside the web directory read the file residing in my_folder over an HTTPS connection continue to fail.
It looks like you might be using Plesk, but that is just a guess. If so, then you also need to create a vhost_ssl.conf file with the same settings (and re-generate the httpd.include file using websrvmng).
If you are not using Plesk, the issue is likely to be the same thing, in that you may have separate virtual hosts configured for http and https, and you need to also modify the https one to remove the restriction.