How to Increase the Post Max Size LimitInstructions on How to Increase the Post Max Size Limit Show
Max Post Size is the maximum size for all POST body data. The post_max_size directive can be set in
The minimum recommended size is 32M Changing server directives is recommended to site owners who are confident to do so. If you rather have professionals do this for you, contact your hosting provider.
We use cookies to maintain login sessions, and to improve your experience on our website. By continuing to use our site, you accept our use of cookies, Privacy Policy and Terms of Service. Aug 23, 2022 Edvinas B. & Prasasti P. 3min Read Download eBook: Speed Up Your Website. 8 Practical Tips That Work When you try running a script, plugin, or uploading large files to your website, you 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. In this article, we will show you three easy ways to increase the size limit by modifying the PHP maximum upload size.
Why Change the PHP Max Upload Size?The default maximum upload file size may vary depending on your hosting provider, usually staying around 128 MB. While this is typically enough for audio or picture files, you may encounter an error 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 hand, 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 panel or manually modifying specific scripts that handle file uploads. In most cases, you can change the PHP maximum file size limit by editing the php.ini file. If you are using a shared or cloud hosting plan, you’ll want to modify the .htaccess file instead. Clearing the cookies will log you out of previously-visited websites. Thus, we recommend saving your login information before following this method. Let’s take a look at three easy ways to edit your PHP settings and adjust your upload file size limit. Option 1. Changing Maximum Upload File Size via hPanel
Important! Note that the postMaxSize should always be larger than uploadMaxFilesize to avoid errors when uploading data. Option 2. Altering PHP Parameters Using cPanel
Option 3. Changing PHP Post Max Size via the .htaccess File
Pro TipYou can also edit .htaccess via an FTP client like FileZilla. If you can’t find the .htaccess file, configure your control panel or FTP client to display hidden files. How to Check the Maximum File Size Value?After changing the settings of your uploaded file size limits, we need to confirm them with the phpinfo() function to ensure they’re already implemented on the system. Simply create a new PHP file in the public_html directory of your site and insert the following PHP code: <?php phpinfo(); phpinfo(); You can name the file anything you want. In this example, we named it phpinfo.php. To access the file we just created, just add /phpinfo.php at the end of your site’s domain. It may look like this: http://yoursite.com/phpinfo.php. You’ll see two columns — local value and master value. Local values are set within .htaccess and override the master values which are set within the php.ini file. Pay no mind to the master 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. ConclusionBy modifying PHP settings on your web server, you may no longer encounter errors during file upload processes. This method lets you submit larger files to the web server by increasing the default limit for uploads. Alternatively, you can decrease it to reserve storage space. If you have questions or other tips and tricks about this topic, leave them in the comment section below. Edvinas is a professional mentor and trainer of customer support agents. When he's not teaching the secrets of providing exceptional service, he likes to travel the world and play basketball. Pras is a Digital Content Writer at Hostinger. With his IT education and experience as a website administrator, he hopes to share his knowledge with other tech enthusiasts. In his free time, Pras likes to play video games. How do I change the maximum upload size in PHP ini?To increaes file upload size in PHP, you need to modify the upload_max_filesize and post_max_size variable's in your php. ini file. In addition, you can also set the maximum number of files allowed to be uploaded simultaneously, in a single request, using the max_file_uploads . Note that from PHP 5.3.
How do I increase post max size?How to Increase the Post Max Size Limit. In your WordPress root installation locate any of these .htaccess , php.ini , .user.ini or wp-config.php.. Edit the file and paste the directive code.. Once you are done making changes save the file.. What is post max size?post_max_size is the maximum size for all POST body data. It doesn't matter if you're POSTing JSON or your DVD collection, this is all POST body data. Your file upload counts towards this limit.
How do I change the maximum size of PHP ini in WordPress?To do this, login to your WordPress hosting account dashboard and go to the 'Software' section. Then, click on 'MultiPHP INI Editor'. Next, scroll down to the section labeled 'upload_max_filesize' and enter a new maximum filesize into the box. Then, click the 'Apply' button.
|