STS Host and Tech Knowledge base
Close this search box.

How to change the upload file size for PHP

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:

  1. Editing the php.ini file directly.
  2.  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
multiphp editor for PHP
  • 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

change upload file size

Watch the tutorial below,

Share Article

Related Articles