File uploads fail in RoundCube and the cPanel error log shows:
PHP message: PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0
This occurs because cPanel's internal PHP cannot find the upload directory for the account.
We have seen this error on a server where PHP-FPM was enabled for cPanel (not for the account's websites). When PHP-FPM for cPanel is enabled, you can check to see what upload directory is being attempted by looking in /var/cpanel/php-fpm.d/$USER.conf. There is an entry like this:
php_admin_value[upload_tmp_dir] = "/home/$USER/tmp"
When a user is created on /home/ and then moved to a different partition, a symbolic link is created. This error occurs most often when the symbolic link is missing.
Create the missing symbolic link. If you moved the account from /home/ to /home2/ it would look like this:
ln -s /home2/$USER /home/$USER