You can get an error when trying to launch a script, plugin, or upload huge files to your website. One of the possible causes of this problem is that the upload exceeds your web server’s preset maximum file size configuration.
We’ll show you three simple ways to increase the size limit by altering the PHP maximum upload size in this article.
The default limit upload file size varies per hosting provider, however it is usually around 128MB. While this is usually sufficient for music or picture files, huge files, such as extended films, may result in an error.
If your site is mostly made up of this type of information, you may wish to increase the upload file size limit to give yourself more options. If you have a restricted amount of storage, you may want to reduce the PHP maximum post size.
There are a few ways to change the maximum upload file size on your site, and they may differ depending on your circumstances and preferences. Users can adjust PHP parameters in their hosting control panel’s PHP configuration menu or by manually editing particular scripts that manage file uploads.
In most circumstances, altering the php.ini file will change the PHP maximum file size limit. If you’re on a shared or cloud hosting plan, you’ll need to make changes to the. htaccess file instead.
Let’s look at three simple techniques to change your PHP settings and increase the size of your upload files.
php_value upload_max_filesize XXM
php_value post_max_size XXM
After making changes to your uploaded file size limits, we’ll need to double-check them with the phpinfo() function to make sure they’re in place. Simply create a new PHP file in your site’s public_html directory and paste the following PHP code into it:
<?php
phpinfo();
phpinfo();
You are free to name the file whatever you want. We called it phpinfo.php in this case. Simply append /phpinfo.php to the end of your site’s domain to view the file we just produced. It could be something like http://yoursite.com/phpinfo.php.
There are two columns in this table: local value and master value. Local values override master values set in the php.ini file and are set in the.htaccess 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 match what you specified, you’ve successfully modified the PHP file size restrictions for your website.