PHP upload limit is a PHP configuration setting that specifies the maximum size of a file that can be uploaded to a server with Website / WordPress. PHP uses this setting to limit the size of uploaded files and prevent the server from running out of memory or disk space. The filesize values, input time, and memory limit settings are expressed in bytes. Still, it can also be defined in megabytes or gigabytes by appending the letter M or G, respectively.
PHP limit can be increased per the script, WordPress plugin and theme requirement. Navigate to the section, cPanel > File Manager > Click on the directory or folder where your website is located > You will see the file named .htaccess > Right-click on it and click on Edit > Then save the following code anywhere:
php_value memory_limit 256M php_value upload_max_filesize 256M php_value post_max_size 128M php_value max_execution_time 300 php_value max_input_vars 2000 php_value max_input_time 1000
When updating the PHP limit, you must take into consideration other directives-
- post_max_size, which must be larger than upload_max_filesize.
- memory_limit, which should be larger than post_max_size.
- For example, if the “upload_max_filesize” is set to 256M, the maximum size of a file that can be uploaded is 256 megabytes. If you upload a file larger than this limit, you will receive an error message indicating that the file is too large.
- You can change the values like memory limit, input time, execution time, etc., as needed.
- If the .htaccess file is hidden, Once in the File Manager, You can check if hidden files are enabled in Settings ( upper right corner )
- But if it doesn’t show the .htaccess file, there is no .htaccess file. Create a new file called .htaccess