Accessing Plesk directories outside httpdocs / php open_basedir error

PHP open_basedir errors occur when a script tries to access a directory outside of httpdocs. For security reasons Plesk only allows access to the httpdocs and tmp directories.

So what if you need to access a different directory?

The easiest way is to amend the vhost.conf file of the
specific domain.

Open the vhost.conf file if it exists. If not...create it. The vhost.conf file is found under /PATH-TO-DOMAIN/YourDomain.tld/conf/vhost.conf

Add these lines:-

<Directory /PATH-TO-DOMAIN/YourDomain.tld/httpdocs>
php_admin_value open_basedir /PATH-TO-DOMAIN/YourDomain.tld/httpdocs:/tmp:/ADD-YOUR-DIR:/
</Directory>

Save the vhost.conf file and run this command to load the changes into Apache

/usr/local/psa/admin/sbin/websrvmng -a -v

Restart Apache....your finished

 

Filed under: 

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.