Common causes
- upload_tmp_dir in php.ini points to a folder that does not exist
- The system /tmp directory is full, removed or has wrong permissions
- open_basedir restrictions exclude the temp directory
- A server migration or PHP version change reset the PHP configuration
- Systemd PrivateTmp or container setups giving PHP-FPM a temp dir that was cleaned
How to fix it
- Check the active temp setting. Look at upload_tmp_dir and sys_temp_dir in Site Health > Info > Server or a temporary phpinfo() page. An empty value means PHP falls back to the system temp directory.
- Create a private temp folder. Create a folder outside public_html, for example /home/user/tmp, owned by your account with permissions 750 or 755. Avoid placing it inside the web root.
- Point PHP at it. Set upload_tmp_dir to that folder in cPanel MultiPHP INI Editor, hPanel PHP options, php.ini or .user.ini. Make sure it is inside any open_basedir paths.
- Set WP_TEMP_DIR as well. Add define('WP_TEMP_DIR', '/home/user/tmp'); to wp-config.php so WordPress uses the same folder for plugin and core update downloads.
- Check disk space. Run df -h on a VPS or check disk usage in the hosting panel. A full disk or a full /tmp partition causes the same error.
- Restart PHP-FPM on a VPS. After changing php.ini, restart PHP-FPM (e.g. systemctl restart php8.3-fpm) and retry the upload.
php.ini / .user.ini and wp-config.php
; php.ini or .user.ini
upload_tmp_dir = /home/user/tmp
// wp-config.php
define( 'WP_TEMP_DIR', '/home/user/tmp' ); How to stop it happening again
- Document custom PHP settings so they are reapplied after migrations
- Monitor disk usage and clean old backups from the account
- Keep temp directories outside the public web root