Increase Import/Upload limit for phpMyAdmin and File Manager in CWP

by Sandeep B.

In this tutorial I’ll show you the configs in order to increase the upload memory limits under CWP control panel. By default upload limit is set to 64MB which is good for small databases and file import/upload through phpmyadmin and through file manager.

Below tutorial will guide you to increase upload limits quickly via command line, ensure you’ve root access and already logged into ssh terminal.

Lets get started :

I’ve created simple command which will increase upload limit automatically :

First backup existing CWP config file and php.ini by below command :

cp /usr/local/cwp/php71/php.ini /usr/local/cwp/php71/php.ini.bak
cp /usr/local/cwpsrv/conf/cwpsrv.conf /usr/local/cwpsrv/conf/cwpsrv.conf.bak

Since update will revert back the config files and modifications in order to prevent I’ve created some simple one lined commands to modify it quickly :-

TO increase the upload limit to 512MB use the below commands one by one via terminal/ssh console:

sed -i 's,^post_max_size =.*$,post_max_size = 512M,' /usr/local/cwp/php71/php.ini && service cwpsrv-phpfpm restart
sed -i 's,^upload_max_filesize =.*$,upload_max_filesize = 512M,' /usr/local/cwp/php71/php.ini && service cwpsrv-phpfpm restart
sed -i 's,^max_input_time =.*$,max_input_time = 1800,' /usr/local/cwp/php71/php.ini && service cwpsrv-phpfpm restart
sed -i 's,^max_execution_time =.*$,max_execution_time = 1800,' /usr/local/cwp/php71/php.ini && service cwpsrv-phpfpm restart
sed -i 's,^memory_limit =.*$,memory_limit = 1024M,' /usr/local/cwp/php71/php.ini && service cwpsrv-phpfpm restart
sed -i 's/client_max_body_size .*$/client_max_body_size 512M;/g' /usr/local/cwpsrv/conf/cwpsrv.conf && service cwpsrv restart

replace 512M to your desired value

You can always increase to higher upload limit for example for 5GB/5120M upload Limit use the below commands one by one via terminal/ssh console:

sed -i 's,^post_max_size =.*$,post_max_size = 5120M,' /usr/local/cwp/php71/php.ini && service cwp-phpfpm restart
sed -i 's,^upload_max_filesize =.*$,upload_max_filesize = 5120M,' /usr/local/cwp/php71/php.ini && service cwp-phpfpm restart
sed -i 's,^max_input_time =.*$,max_input_time = 3600,' /usr/local/cwp/php71/php.ini && service cwpsrv-phpfpm restart
sed -i 's,^max_execution_time =.*$,max_execution_time = 3600,' /usr/local/cwp/php71/php.ini && service cwpsrv-phpfpm restart
sed -i 's,^memory_limit =.*$,memory_limit = 1024M,' /usr/local/cwp/php71/php.ini && service cwp-phpfpm restart
sed -i 's/client_max_body_size .*$/client_max_body_size 5120M;/g' /usr/local/cwpsrv/conf/cwpsrv.conf && service cwpsrv restart

replace 5120M to your desired value

Ensure you run this script for auto restart of cwp services :

sh /scripts/restart_cwpsrv

If this post helps you in any way please consider a donation

Donate with PayPal :

md-donate

Donate with Paytm :

md-donate

You may also like

2 comments

Carlos Gallardo November 12, 2018 - 11:51 pm

Work like a charm!

Reply
ahmed ghanim December 27, 2018 - 11:20 pm

how can increase timeout passed

Reply

Leave a Comment