Unable to upload file to WordPress website hosted on Plesk: Missing temporary

Started by Suhitha, Sep 01, 2025, 06:07 AM

Previous topic - Next topic

Suhitha

Question: Unable to upload file to WordPress website hosted on Plesk: Missing temporary directory


Applicable to:

  • Plesk for Linux



Symptoms

  • Unable to upload a file in Wordpress > example.com > Log in > Media > Add New with the following error
Missing temporary directory

OR

Missing a temporary folder

  • There are the following records in /var/www/vhosts/system/example.com/logs/error_log file:


       
       
AH01071: Got error 'PHP message: PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0\\n', referer: https://example.com/wp-admin/upload.php


Cause

PHP /tmp folder has been removed recently with rm -rf /tmp/* command. The temporary folder might also be removed by 3rd party tools, like tmpreaper package.

Removal of PHP temporary folder resulted in inability to upload files on websites that use certain PHP-FPM handler.


Resolution

Warning: If there is a 3rd party tool software deleting the temporary files, such as tmpreaper package, make sure to configure it properly or uninstall it from the system to avoid any conflict with Plesk and other services

1.Log into Plesk

2.Identify the PHP version used by the domain in Domains > example.com > PHP Settings:


3.Restart the corresponding PHP service in Tools & Settings > Services Management by clicking the restart icon. This will recreate the temporary folder: