Introduction
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 when your site uses the PHP-FPM PHP handler.
Procedure
- 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.yaml
file 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: 1
line.php_admin_value_sys_temp_dir: { name: 'php_admin_value[sys_temp_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
Comments
0 comments
Article is closed for comments.