• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

open_basedir for subdomains?

T

tincup

Guest
Hi. I don't know if this is off-topic in here but my web server is Plesk controlled.

I need to extend the PHP open_basedir of one of my subdomains by "/usr/share/php". So I create a file "vhost.conf" at

/var/www/vhosts/domainname.com/subdomains/subdomainname/httpdocs

with the contents

<Directory /var/www/vhosts/domainname.com/subdomains/subdomainname/httpdocs>
php_admin_value open_basedir "/var/www/vhosts/domainname.com/subdomains/subdomainname/httpdocs:/tmp:/usr/share/php"
</Directory>

This did not work. Does anyone know why?
 
Ok, got it working. This is what I did...

contained the php_admin_value open_basedir directive in:

<Directory foo/bar/httpdocs>
<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_value open_basedir "blabla"
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_value open_basedir "blabla"
</IfModule>
</Directory>

Hope it helps. I'm sure there's some redundancy there that can be cut out.
 
I have copied your code exactly, placing it in a vhost.conf file in the httpdocs folder of the subdomain as described in the first post and nothing happens!

I have restarted the httpd service and ran the following command as suggested in another thread:
/usr/local/psa/admin/sbin/websrvmng -a -v

But still nothing!

Can anyone help!
 
Thanks for your reply. Should have posted back to let everyone know I sorted it in the end after a bit of trial and error and a late night!
 
Back
Top