• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Question move_uploaded_file(): failed to open stream: Permission denied in

Paul0

New Pleskian
Hello,

I am using PHP to upload files to my website. Except: I get this error when uploading the file.
Can anybody please help me?

Thanks in advance.

Greetings,
Paul
 
Make sure that:

1. Check that {TMP} directory is added to open_basedir on Home > Domains > example.com > PHP Settings page:
open_basedir1.png
It is environment variable for C:\Windows\Temp\
If it is required to add some custom directory to open_basedir parameter it can be done as follows:
open_basedir.png

2. IWPG_user, where user is a system user of the subscription who has rights to "Read", "Write" and "Modify" the %windir%\Temp directory. On the screenshot below, the system user of the subscription example.com is an example and the corresponding application pool group is WPG_example:

sys_user.PNG

3. The destination folder from the error message exists in the %plesk_vhosts%\example.com\httpdocs\ directory and the system user from the previous step has similar access rights.
Note: If the destination file is located inside a directory, these permissions must be set to this directory as well (e.g. ./images/)

4. safe_mode and safe_mode_exec_dir parameters of the PHP handler are disabled.
It can be checked on the phpinfo() page of the domain: Plesk > Domains > example.com > PHP Settings > View the phpinfo() page.
If one of options is enabled, disable it by adding a corresponding value in the additional directive at Plesk > Domains > example.com > PHP Settings > Additional configuration directives, for example:

safe_mode_exec_dir = Off
 
Back
Top