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

by Sandy

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,^memory_limit =.*$,memory_limit = 256M,' /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,^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

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
Leave a Reply

avatar
2 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
2 Comment authors
ahmed ghanimCarlos Gallardo Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Carlos Gallardo
Guest

Work like a charm!

ahmed ghanim
Guest
ahmed ghanim

how can increase timeout passed