Maximum File Size Allowed for Upload: 99 Mb
Mar ten, 2022
Edvinas B. & Prasasti P.
3min Read
How to Alter the PHP Maximum Upload Size
When yous try running a script, plugin, or uploading large files to your website, you lot might encounter an error. One of the possible causes of this issue – the upload exceeds the default maximum file size configuration on your web server.
Download eBook: Speed Up Your Website. 8 Practical Tips That Piece of work
In this commodity, nosotros volition testify you 3 easy ways to increase the size limit by modifying the PHP maximum upload size.
Why Alter the PHP Max Upload Size?
The default maximum upload file size may vary depending on your hosting provider, ordinarily staying around 128MB. While this is typically enough for sound or picture files, you may come across an fault when uploading large files such as long videos.
If your site consists mainly of such content, you might want to increase the upload file size limit for more flexibility. On the other mitt, you may wish to decrease the PHP max post size if you have limited storage.
How to Change the Maximum Upload Size for PHP Scripts?
There are several methods to modify your site's maximum upload file size, and they may vary depending on your circumstances and preferences. Users can change PHP parameters by using the PHP configuration menu on their hosting control console or manually modifying specific scripts that handle file uploads.
In most cases, yous tin alter the PHP maximum file size limit by editing the php.ini file. If you are using a shared or cloud hosting programme, you'll want to modify the .htaccess file instead.
Clearing the cookies will log you lot out of previously-visited websites. Thus, nosotros recommend saving your login information before post-obit this method.
Permit's take a look at three easy ways to edit your PHP settings and arrange your upload file size limit.
Option 1. Changing Maximum Upload File Size via hPanel
- To alter file upload limitations in Hostinger's hPanel, click Manage on the Hosting console and look up PHP Configuration in the Advanced section.
- Open the PHP Options tab. Users can change diverse limits and parameters on this page, including max execution time and memory limit.
- To change the maximum size for uploaded files, search for the uploadMaxFilesize field. Choose your desired data size from the drop-down carte. In the case below, the default size is set to 512 MB.
- Another pick you might desire to change here is postMaxSize. It controls the maximum size of files uploaded using the POST method.
- Don't forget to click Save at the bottom right corner of the page after you terminate editing the settings.
Note that the postMaxSize should always be larger than uploadMaxFilesize to avoid errors when uploading information.
Option ii. Altering PHP Parameters Using cPanel
- Access your cPanel dashboard and detect Select PHP Version in the Software section. In this card, users can change their PHP version, choose which extensions to actuate, and change other PHP-related settings.
- Click the Options tab and search for post_max_size and upload_max_filesize. Cull your desired file upload limits from the dropdown menu.
Option 3. Changing PHP Postal service Max Size via the .htaccess file
- To change your post size limits using PHP scripts, navigate to File Manager in your hPanel.
- Open the public_html binder and find .htaccess.
- Open the file and insert the post-obit PHP scripts:
php_value upload_max_filesize XXM
php_value post_max_size XXM
- Change the "Twenty" into your desired size.
- One time you're done with the configuration, click Salve & Close.
Pro Tip
You can also edit .htaccess via an FTP customer like FileZilla. If you can't find the .htaccess file, configure your control console or FTP customer to display hidden files.
How to Bank check the Maximum File Size Value?
After changing the settings of your uploaded file size limits, nosotros demand to confirm them with the phpinfo() part to ensure they're already implemented on the arrangement. Simply create a new PHP file in the public_html directory of your site and insert the following PHP code:
<?php phpinfo(); phpinfo();
You tin name the file annihilation you want. In this case, we named it phpinfo.php. To access the file we just created, just add /phpinfo.php at the end of your site'due south domain. It may look similar this: http://yoursite.com/phpinfo.php.
Y'all'll see two columns — local value and master value. Local values are set up inside .htaccess and override the primary values which are set within the php.ini file. Pay no mind to the primary values and seek the local values for upload_max_filesize and post_max_size instead.
If the local values of both parameters are the same as you configured, you have successfully changed your website's PHP file size limits.
Decision
By modifying PHP settings on your spider web server, yous may no longer run into errors during file upload processes. This method lets you submit larger files to the web server by increasing the default limit for uploads. Alternatively, yous tin can decrease it to reserve storage space.
If you take questions or other tips and tricks about this topic, leave them in the comment department below.
Source: https://www.hostinger.com/tutorials/php-maximum-upload-size
0 Response to "Maximum File Size Allowed for Upload: 99 Mb"
Post a Comment