Applicable to:
- Plesk for Linux
- Plesk for Windows
Symptoms
-
A website is not accessible with one of the following errors in a web browser:
404 file not found
500 Internal Server Error
Error 500 move_uploaded_file(): open_basedir restriction in effect. File(/path/to/the/directory) is not within the allowed path(s): (/var/www/vhosts/example.com/:/tmp/)
No input file specified.
-
The following error message appears in the domain's Logs page (Domains > example.com > Logs):
<...> open_basedir restriction in effect. File(/path/to/the/directory) is not within the allowed path(s) <...>
Uncaught Exception: Session: Configured save path '/path/to/the/directory' is not a directory, doesn't exist or cannot be created.
Cause
The PHP script is trying to access the folder for which access is not allowed. This restriction is defined by the PHP open_basedir variable for each domain separately. By default, open_basedir allows access to the tmp and domain's document root directories, as well as the system's default sessions path.
Resolution
-
Go to Domains > example.com > PHP Settings.
-
Add the path from the error message to the
open_basedirfield:on LinuxBelow is an example for the directory /path/to/the/directory:
{WEBSPACEROOT}{/}{:}{TMP}{/}{:}/path/to/the/directory
on WindowsBelow is an example for the directory
E:\path\to\the\directory\:{WEBSPACEROOT}{/};{TMP};{/};"E:\path\to\the\directory\"
-
Apply the changes.
Note: The default session.save_path for Linux is (RedHat-based) /var/lib/php/session/ or (Debian-based) /var/lib/php/sessions/, and for Windows is C:\Windows\Temp
Comments
Invalid INI syntax detected on line 1: '{WEBSPACEROOT}{/}{:}{TMP}{/}{:}/var/www/vhosts/welfabmachine.xyz/httpdocs/components/com_contactenhanced/uploadedfiles'
@Curtis Maurand placeholders will only work when passed via Plesk, otherwise they won't. Hence, I'd recommend reset the value to defaults in Plesk interface and append the path in there.
It is not funny. How to go to Plesk domains if Plesk is not accessible? How to set up SSL which is setting up throus Plesk with no security and not opening? Port 8443 is vulnerable by descriptions of browsers, All serious browsers completely blocked access to not SSL web addresses. I feel I shouldn't leave Godaddy for terrible SSL and mail prices. Yours are free but do not work at all.
Please sign in to leave a comment.