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.iniif it doesn't already exist, or open the existing one.
- Add
upload_tmp_dirdirective:- Insert the following line into the
user.inifile: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.
- Insert the following line into the
- Replace
/home/username/public_html/tempwith 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.inifile.
- Save the modifications to the
