Customizing Script Dir on a Server Running Parallels Plesk Panel
Parallels Plesk Panelconfigures the httpd.include file for each domain for overall site security. As such, it enables the open_basedir directive for PHP, so that a script and/or site can only access files located in the /path/to/vhosts/domain.tld/httpdocs and /tmp directories.
To overcome this setting, the you need to create a vhost.conf file in your /path/to/vhosts/domain.tld/conf directory, and enter the following lines:
Note: Replace domain.tld with your domain name as it was added in Plesk. Because Linux is case specific you will need to use the correct cases for the letters.
Once you create the file, enter the following command:
This updates the main httpd.include file to include the new vhost.conf file, and also gracefully restart the Web service, so the changes take effect.
- Log in to Parallels Plesk Panel as admin. For more information, see Log in to my server.
- If necessary, switch to Service Provider view. For more information, see Accessing Service Provider View in Plesk.
- Click Domains in the left side menu, and then click Open in Control Panel next to the domain name you want to manage.
- Click the Websites & Domains tab, at the top of the screen.
- Click the name of the domain that you need to edit.
- Click the PHP Settings tab.
- Scroll down until you see open_basedir, on the left of the screen, and then select Enter custom value.
- Add the needed directories to the current entries.
- Click OK.
Note: Plesk automatically restarts the Apache instance for your domain and reload the new settings. Test your site to make sure it is working the way you want it to and make additional changes as needed.
Note: The list of directories used to limit the files can be opened by PHP. If the file is outside the specified directories, PHP scripts will refuse to open it. To separate directories, use a colon (:) on Linux and a semicolon (;) on Windows. For example, on Linux: /dir/upload:/usr/tmp