---
title: "Changing the upload_max_filesize in php.ini"
description: "There are a few common errors that occur in Wordpress and other PHP-based programs that use the php.ini for certain settings. One of the most common of these settings is the maximum upload filesize..."
url: https://www.inmotionhosting.com/support/website/increase-the-max-file-upload-size-in-php-ini/
date: 2013-04-08
modified: 2023-12-07
author: "InMotion Hosting Contributor"
categories: ["Website"]
type: post
lang: en
---

# Changing the upload_max_filesize in php.ini

There are a few common errors that occur in WordPress and other PHP-based programs that use the **php.ini** for certain settings. One of the most common of these settings is the maximum upload filesize (“**upload_max_filesize**“). This is a setting commonly found within a file known as the **php.ini** file.

Here’s an example screenshot of a program with max file size limits exceeded during an upload attempt:

![Upload error occurring in WordPress due to PHP.INI limit](https://www.inmotionhosting.com/support/wp-content/uploads/2013/04/edu_phpini_upload-wp-error.png)

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

You will need to increase the allowed memory in your **php.ini** file. The instructions below will show you on how to fix the php memory error by adjusting the appropriate sections of your local **php.ini** file.

## Fixing the “Maximum upload size exceeded” Error

1. [Login to your cPanel.](/support/edu/cpanel/how-to-log-into-cpanel/)
2. Scroll down to the **FILES** section of your Cpanel, and then click on the icon labeled **FILE MANAGER**.
3. Use the File Manager to navigate to the web root. For more information on understanding your web root or document root, see [*What folder are my website files located within?*](/support/)
4. Locate the **php.ini** file in your *public_html* folder. If you do not have one, our [Technical Support team](/support/amp/how-to-get-great-technical-support/) can place a default one in your account, or you can create a blank file by clicking on the **New File** icon and naming it **php.ini** so you can edit and add your own settings. Once you have a **php.ini** file, click on the file name to highlight it in 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](/support/edu/cpanel/file-manager-code-editor/).
5. Search the **php.ini** file for the following text: ;;;;;;;;;;;;;;;; ; File Uploads ; ; ;;;;;;;;;;;;;; ; Whether to allow HTTP file uploads. file_uploads = On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). ;upload_tmp_dir = ; Maximum allowed size for uploaded files. upload_max_filesize = 128M The *file_uploads* should be set to “on” and “*Maximum allowed size for uploaded files*” should be set to the file size that you need.
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.Â  For more information, see [*How can I make my **php.ini** file recursive?*](/support/website/recursive-php-ini/)
