Knowledge Base
MilesWeb / How-Tos

How to change the maximum upload size in php.ini?

Approx. read time : 3 min

There are a couple of common errors that you may encounter with while using WordPress and other PHP-based programs that use the php.ini for certain settings. One of the most common is the maximum upload filesize settings (“upload_max_filesize“). This setting can be found within a file known as the php.ini file.  Below is an example screenshot of a program with max file size limits exceeded during an upload attempt:

Fixing the "Maximum upload size exceeded" Error

Error text: file_name” has failed to upload due to an error – This file exceeds the maximum upload size for this site.

To fix this error, you will need to increase the allowed memory in your php.ini file. The instructions below will help you to fix the php memory error and for this, you will need to make some adjustment in the appropriate sections of your local php.ini file.

Fixing the “Maximum upload size exceeded” Error

Step 1: Login to your cPanel Control Panel.

Step 2: Scroll down to the FILES section of your cPanel, and then click on the FILE MANAGER icon.

Step 3: Use the File Manager to navigate to the web root.

Step 4: Search for php.ini file in your public_html folder. If the file is not there, you can ask our Technical Support team member to place a default one in your account or you can simply create a blank file by clicking on the New File icon and naming it php.ini. Once you are done, you can edit and add your own settings.

Once you have a php.ini file, click on the file name to highlight it on the right side of the File Manager. If you need further information on editing with the File Manager editors, go to Using the File Manager Code Editor.

Step 5: Search the php.ini file for the following text:

The file_uploads should be set to “on” and “Maximum allowed size for uploaded files” should be set to the file size that you will need.

Step 6: Click the Save Changes button to save your changes.

This change affects all files within the directory that a php.ini is saved unless the file is set to be recursive.  If it is set to be recursive, then it affects all directories as per the setting in the .HTACCESS file.

Avatar
Pravin is Journalist Specializing in Blogging, Social Networking and Community Management. As a constant learner, he is always aiming towards new ideas and greater knowledge. When he is not doing research, reading, or writing for blogs, you can find him hanging around social media sites.