This article discusses how to modify a cPanel user's PHP upload path (as WHM administrator). This guide assumes root-equivalent access to a cPanel VPS or cPanel dedicated server.
About PHP Upload Path
PHP uses a system variable to determine the upload path. By default, this is configured as /tmp. The standard workflow uploads a file to /tmp, and then moves it into the site's upload path. This article provides the procedure to change the default upload path.
How to Modify a cPanel User's PHP Upload Path
There procedure to modify a cPanel user's PHP upload path is contingent upon whether the domain uses the PHP-FPM PHP handler or not. We will discuss both processes below.
-
Modify PHP Upload Path for Domain Using PHP
- Log in to the user's cPanel account.
- Open the "MultiPHP INI Editor" app in the "Software" section.
- Click the "Editor Mode" tab.
- From the "Select the home directory or a domain’s document root to open the corresponding PHP configuration" dropdown menu, select the domain to change the upload path.
- Add the following line in the textbox.
sys_temp_dir = "/path/to/new/upload/folder"
Please note that "/path/to/new/upload/folder" must be replaced with the absolute path to the new upload location. - Click the "Save" button.
-
Modify PHP Upload Path for Domain Using PHP-FPM Handler
- Access the server's command line as the 'root' user via SSH or "Terminal" in WHM.
- Open the
/var/cpanel/userdata/$cpuser/domain.tld.php-fpm.yamlfile in your preferred text editor.
Please note that "$cpuser" and "domain.tld" must be replaced with the cPanel username and the domain to change the upload location. - Add the following line to the file on a new line after the
_is_present: 1line.php_admin_value_upload_tmp_dir: { name: 'php_admin_value[upload_tmp_dir]', value: "/path/to/new/upload/folder" }Please note that "/path/to/new/upload/folder" must be replaced with the full path to the new upload folder. - Save the changes and exit the text editor.
- Rebuild the PHP-FPM configuration.
/scripts/php_fpm_config --rebuild
Conclusion
You now know how to modify a cPanel user's PHP upload path.

👀 Choose SSD-powered VPS servers for increased speed, power, and security! Now 50% off- starting from only $3.19/mo.