PHP scripts come in handy for managing dynamic content, session tracking, databases, and building entire ecommerce websites. So, it is pretty obvious that you might need to have larger scripts on your server. As a default, the upload size is set to 50 MB.
When you feel the need to change PHP max upload size, you can simply make some modifications to the php.ini file. To know what exactly maximum upload file size in cPanel is and how to increase it, read on.
What is “upload_max_filesize” in PHP /cPanel?
“upload_max_filesize” is a configuration directive in PHP and cPanel that determines the maximum size limit for uploaded files on a server. It specifies the maximum file size that PHP allows to be uploaded via file upload forms or scripts. This setting is defined in the PHP configuration file (php.ini) and can also be modified through the cPanel interface. By default, the PHP max upload size is typically set to a relatively low limit.
However, it can be adjusted to a higher value to accommodate larger file uploads. It is important to note that increasing the value should be done cautiously to avoid potential server resource issues.
Some Prerequisites You Need to Check for PHP Max Upload Size
But before you go forward with this, you need to double-check something. Make sure that your PHP is set to a Single php.ini option in the cPanel. This is the first step if you would like to know how to change file size. Here, the FastCGI settings or the default options would not work. You will need to take a look at the
PHP Version Selection option if you do not know what this means.
The
phpMyAdmin in the cPanel will not be disturbed when you do this. A different php.ini file is used there, which is accessible only to the server administrators.
You need to start by accessing your
Bluehost account. If you are not sure if you are using Bluerock or Legacy, find that out first.
Make changes to the php.ini file
There are two parameters in the php.ini file that you ought to be changing to change the PHP max upload file size. These are:
- upload_max_filesize
- post_max_size
Let us see how you can change both of them in Bluerock and in Legacy.
How to Increase Max Upload Size in cPanel
Bluerock
- Log in to your Bluehost control panel.
- Click on the Advanced tab. You can find it on the navigation menu on the left.
- Click the File Manager option under that in the file section.
- On the right-side panel, you will have to scroll down and find the php.ini file.
- Right-click on the file and select the Edit option.
- When the file opens, search for the parameters that you need to change. Use the keyboard shortcut for that:
For Windows/Linux: Ctrl+F
For Mac: Command+F
- Type in upload_max_filesize and press Enter. The line with upload_max_filesize = 50M will get highlighted. You need to reset the maximum limit here
- Again, open the ‘Find’ window and type ‘post_max_size’. You will find the option post_max_size = 50M highlighted. You will need to enter the same size (as you entered in the previous parameter) here as well. In this way, you can change the post max size in PHP
- Now you click on ‘Save’ to save the changes
If you do not have the php.ini in File Manager, you would be able to edit the parameters through the MultiPHP INI Editor under the Software section.
Legacy
- Login to your Bluehost control panel.
- Open File Manager in the file section.
- Choose to open Web Root and Show the hidden files
- Click on the Submit button
- Scroll in the right-hand panel to locate the php.ini file
- Right-click on the file and select the Code Edit option
- Click on edit in the pop-up for character set selection.
- Use the keyboard shortcut to open the Find window:
For Windows/Linux: Ctrl+F
For Ubuntu: Command+F
- Type in upload_max_filesize and press Enter in the Search field.
- This will highlight that parameter and it will be set as upload-max_filesize = 50M. Change this value to your preferred size.
- For the second parameter, open the Find dialog again and type post_max_size, and press Enter.
- You will find another highlight as post_max_size = 50M. Change this number to the same value you put in the other field.
- Save the changes you made. When you change these parameters that control the PHP max upload file size, your job is done.
memory_limit
Some of the incoming data will have to be stored in memory at times when the PHP engine is handling an incoming POST call. This will only be effective in the case that you have enabled the –enable-memory-limit option when you have added or updated the configuration. However, you need to keep something in mind. If you had set a very high value, that would be a dangerous mistake. A lot of uploads will be handled concurrently. This would lead to maxing out the memory limit and cause issues in performance.
- max_execution_time
- max_input_time
The maximum lifetime of the script and the time that the script would allow for input can be mentioned in these settings. If a lot of data is being transferred, which could be several megabytes, the max_input_time should be quite high. It is possible for you to change this setting in the .ini file as well. You can change the max_input_time by calling the set_time_limit() function in the scripts.
You can even tweak Apache settings
By default, the Apache webserver will restrict all the POST data size through the LimitRequestBody configuration directive. Regardless of the scripting language that you are using, this setting would be applicable. There are some RPM installations where the limit request body is set to 512 KB. You can either change the value to something larger or you could completely remove this entry to do away with the limits. This is another point you should remember when you want to know how to increase upload file size in WordPress.
What other options are available to you?
Well, if you are expecting that these settings would not be enough, you would probably need to use a PERL or Java server-side component. You might have a preference for PHP as a web programming language. However, when it comes to file handling, PERL can definitely give you an edge. When you are trying to look into how to increase maximum upload file size in cPanel, this piece of information will be useful to you.
Most of the PERL installations for the Apache module allow you to accept 32 MB right out of the box. With PHP, you get a default of just 2 MB. The only problem with PERL is that you would need to put a little more coding effort when compared to PHP. However, if you are trying to get good results, you should consider doing that.
Conclusion
With the above step-by-step guide to navigate cPanel and modify PHP settings, you can effortlessly increase the maximum upload file size in cPanel. Thus, enhancing your website’s functionality. A higher file size limit provides greater flexibility, irrespective of whether it’s media files, documents, or other content.
However, it’s crucial to consider your server resources and select an appropriate limit to avoid any potential issues. By optimizing the maximum upload file size in cPanel, you can improve website performance and provide users with a seamless uploading experience.
Write A Comment