tags:

views:

78

answers:

1

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.

+1  A: 

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.

Tom Haigh
This is what I suspect, too. Is there a way to set up the SSL version of a site w/o giving it its own virtual host? (I guess you could include a common conf into each, but this still functions fundamentally as two separate site configs...)
grossvogel
I don't think so, you have to do 'SSLEngine on' in the vhost, which I think stops plain http from working
Tom Haigh
Tom, thanks so much for your answer, that worked perfectly. I am using plesk and was unaware this file was needed.