Change the PHP Temporary Upload Directory on cPanel

In a cPanel shared hosting environment, a shared user can change the temporary upload directory for PHP by modifying the upload_tmp_dir setting within a user.ini file.
 
Steps to Change the Temporary Upload Directory:
 
  • Create or Edit user.ini:
    • Navigate to the project's root directory using cPanel File Manager.
    • Create a new file named user.ini if it doesn't already exist, or open the existing one.
  • Add upload_tmp_dir directive:
    • Insert the following line into the user.ini file: 
      upload_tmp_dir = /home/username/public_html/temp
    • Do not use /home/username/tmp (delete all from this folder will lost all the statistics data. 
  • Replace /home/username/public_html/temp with the desired path for the temporary directory. This directory should be within the user's home directory for security and proper functioning in a shared environment.
     
  • Save Changes:
     
    • Save the modifications to the user.ini file.
Was this answer helpful? 0 Users Found This Useful (0 Votes)