There are many reasons that you might need to increase or decrease your maximum upload file size for PHP. In this article we will describe how to change PHP maximum upload file size by two ways:
- Editing the php.ini file directly.
- From cPanel WHM control panel.
Change the maximum upload file size for PHP via SSH
Edit your php.ini file (usually stored in /etc/php.ini or /etc/php.d/cgi/php.ini or /usr/local/etc/php.ini):
vi /etc/php.ini
And start to change the values for both uploadmax_filesize and postmax_size.
Modifying in cPanel/WHM
- First, login to your cPanel control panel
- Go to Home » Software » MultiPHP INI Editor
- Select Editor Mode then select the php version you are planning to use.
- Select the home directory or a domain’s document root to open the corresponding PHP configuration, then start edit the values and save the file.
For example, to set Maximum allowed size for upload files to 256 MB, add these two values in php ini editor:
uploadmax_filesize = 256M
postmax_size = 256M
Watch the tutorial below,