Tutorial - CWP Big file upload via File Manager | Vevioz Community

Tutorial CWP Big file upload via File Manager

DevOps

Linux Systems Engineer
Joined
Oct 18, 2019
Messages
168
Reaction score
14
Points
18
Location
Indonesia
Website
addons.vevioz.com
Offline
To upload a big file via File manager, we need to edit CWP PHP configuration.
First backup configuration file: /usr/local/cwp/php71/php.ini

Code:
cp /usr/local/cwp/php71/php.ini /usr/local/cwp/php71/php.ini.bak

Edit configuration file: /usr/local/cwp/php71/php.ini

Code:
nano /usr/local/cwp/php71/php.ini

Locate upload_max_filesize, post_max_size and memory_limit.
Change to your size, in this case we are using 500MB, please note that post_max_size and memory_limit need to be greater than upload_max_filesize

Example for 500MB File:

Code:
upload_max_filesize = 500M
post_max_size = 550M
memory_limit = 1024M
max_input_time = 300
max_execution_time = 300

* Save the file /usr/local/cwp/php71/php.ini

Edit configuration file: /usr/local/cwpsrv/conf/cwpsrv.conf

Code:
nano /usr/local/cwpsrv/conf/cwpsrv.conf

Edit line client_max_body_size and set it to 550M

Code:
client_max_body_size 550M;

* Save the file and restart cwp

Code:
sh /scripts/restart_cwpsrv

cpanel subdomain​

If you will be using File Manager for uploading big files over the cpanel subdomain like example cpanel.domain.com then you would need to edit all your webservers also:

Nginx (File: /etc/nginx/nginx.conf)
client_max_body_size 550M;

Apache (File: /usr/local/apache/conf/httpd.conf)
LimitRequestBody 504857600

More Detailed Info​

upload_max_filesize: By default this value is 64MB. We need to increase it to the maximum size of a single file that we want to upload.

post_max_size: It defines the maximum size of POST data that PHP will accept. This value should be greater than upload_max_filesize.

memory_limit: This sets the amount of memory a PHP script is allowed to use during its execution. Set this to a value greater than post_max_size so that PHP script can load and process the uploaded file.

max_input_time: This sets the maximum time in seconds a script is allowed to parse input data, like POST and GET. Timing begins at the moment PHP is invoked at the server and ends when execution begins. This would include populating $_FILES superglobal.

max_execution_time: The time a script is allowed to run after its input has been parsed. This would include any processing of the file itself.
 
Top Bottom