Saturday, September 14, 2024
HomeTechnologyHow To Increase PHP Upload Limit On A cPanel Server

How To Increase PHP Upload Limit On A cPanel Server

PHP protects server performance by limiting file upload sizes, but the default limit is too low for many modern web applications. You’re likely to solve this issue when a PHP application shows an error message asking you to increase the PHP max upload file size. There are various ways to increase the upload limit. In this article, we’ll show you how to increase PHP upload limit on a cPanel server.

What Is “upload_max_filesize” in PHP?

upload_max_filesize is a setting or property managed through the PHP Options, which sets the maximum size of each uploaded file.

How To Increase PHP Upload Limit on a cPanel Server?

There are various ways to increase PHP upload limits on a cPanel server while not allowing direct changes to PHP.ini on our servers. PHP configuration can be changed in cPanel by following these steps:

  1. Log into cPanel.
  1. Navigate to the Software section and click on Select PHP version or search for select PHP version.
  1. Open PHP selector and click on the options.

4) Here you can see the upload_max_filesize and click on this and a dropdown menu or text input box will appear, allowing you to change the value as required. Check your script, plugin, or theme’s documentation (or an on-screen error message) to find the correct value.

5) Once you make any changes, please do a left-hand side click anywhere outside the dropdown or text input box. If the change was successful, you will see a green box with a message confirming that the change has been applied.

Increasing PHP Upload Limit Using “MultiPHP INI Editor”
This is another way to increase PHP upload limits on a cPanel server while allowing direct changes to PHP.ini on our servers. PHP configurations can be changed in cPanel by following these steps:

  1. Open your cPanel account and navigate to “MultiPHP INI Editor” in software section.

2. Doing so you will see the next page. The header of the page will include two elements: Basic Mode and Editor Mode. You have to click on Basic Mode.

3. Select a domain for which you want to increase the upload size in ‘Select a Location.’

4. After selecting the domain, you will notice a few sections which allow you to 

  • display_errors
  • max_execution_time
  • max_input_time
  • max_input_vars
  • memory_limit
  • post_max_size
  • session.gc_maxlifetime
  • session.save_path
  • upload_max_filesize
  • Zlib.output_compression

Here You don’t have to save anything. All the changes you make are automatically saved for a seamless process.

  1. Now you can change numerous properties and your desired value of PHP upload limit also in this section.


  2. Click on “Apply

Things To Remind

  • When increasing the PHP upload limit on a cPanel, The post_max_size should be equal to or greater than the upload_max_filesize.
  • There is another value as well, which is called the ‘Memory limit’, and this setting must be larger or equal to the post_max_size as well. 

Upload Max Filesize ≤ Post Max Size ≤ Memory Limit

  • This limit is when uploading to the site directly, e.g. within the /wp-admin/media folder. The upload_max_filesize within the File Manager in cPanel, is up to 2GB. If you need to upload files larger than 2GB, use FTP or SSH.

Conclusion

In this guide we have covered all the important steps of how to increase PHP upload limit on cPanel server. So If you are facing the file size exceeding the maximum upload limit error, you will need to increase the capacity by going to the PHP selector in cPanel.The process is pretty straightforward.If you find any difficulties feel free to contact us at any time. We have skilled cPanel specialists working in all of our shifts, always and around the clock.

Supportfly offers cPanel Server Management Services and cPanel System Administration Services. In addition you get Certified Server Support at low prices.

FAQs(Frequently Asked Questions)

Does cPanel support PHP?

When you install cPanel the installation process automatically install PHP with some common PHP options.

What is the PHP memory limit in cPanel?

The default PHP Memory Limit on your server is 256MB in cPanel. The universal recommended baseline is 128MB, which is more than enough for most of the websites unless they have a plugin or theme that needs more. You can always customize this value inside your cPanel, it depends on your needs.

What is the maximum upload size in PHP?

By default, the maximum upload file size for PHP scripts is 128 megabytes. However, you may want to change this limit. Suppose you want to set a lower limit to prevent users from uploading large files to your site. To do this, change the upload_max_filesize and post_max_size directives.

How to upload PHP script files in cPanel?

Log in to your cPanel account. Go to the “File Manager” option under the “Files” section. Select the directory where you want to upload PHP script. Click the “Upload” button to upload your PHP script file to the directory.

How to upload a 1 GB file in PHP?

To upload large files in PHP, you need to increase the value of the post_max_size variable or upload the files with a total file size lower than the post_max_size value. Also, the post_max_size value must be larger than the upload_max_filesize value.

leasepacket
leasepacket
Best Server Provider Company
RELATED ARTICLES

Most Popular