---
title: "Fix &#8220;uploaded file may exceed the post_max_size directive in php.ini&#8221;"
description: "If you are working in Moodle you may see the error \"The uploaded file may exceed the post_max_size directive in php.ini.\" This error is caused by a PHP limitation when trying to post data. The..."
url: https://www.inmotionhosting.com/support/website/post-max-size-error/
date: 2014-06-20
modified: 2023-03-31
author: "InMotion Hosting Contributor"
categories: ["Moodle", "Website", "Website Error Numbers"]
type: post
lang: en
---

# Fix &#8220;uploaded file may exceed the post_max_size directive in php.ini&#8221;

If you are working in Moodle you may see the error “The uploaded file may exceed the post_max_size directive in php.ini.” This error is caused by a PHP limitation when trying to post data. The php.ini file controls your local PHP settings and can be changed anytime. In this tutorial, I will show you how this issue can easily be fixed in cPanel. In my tests, I got this error when [installing a plugin](https://www.inmotionhosting.com/support/edu/moodle/install-plugin/) from the Moodle Admin Dashboard.

[![post_max_size directing in php.ini error](https://www.inmotionhosting.com/support/wp-content/uploads/2014/06/moodle_exceed-post-max-size-error_moodle-error-exceed-post-max-size.png)](/support/wp-content/uploads/2014/06/moodle_exceed-post-max-size-error_moodle-error-exceed-post-max-size.png)

## Fixing the “exceed the post_max_size directive” error

1. [Login to cPanel](https://www.inmotionhosting.com/support/edu/cpanel/how-to-log-into-cpanel/).
2. Click the **File Manager** button in the *Files* section. If the *Directory Selection* window pops up, click the **Go** button.
3. Navigate to the folder where your Moodle is installed and click the **php.ini** file. Then click the **Code Editor** button on top. If a *Code Editor* box pops up, click the **Edit** button.
4. You will then see the php.ini code displayed. Locate the line starting with: post_max_size (In my tests, it was around line 374)[![view of the Moodle settings causing issues](https://www.inmotionhosting.com/support/wp-content/uploads/2014/06/moodle_exceed-post-max-size-error_post_max_size-php-ini-file.png)](/support/wp-content/uploads/2014/06/moodle_exceed-post-max-size-error_post_max_size-php-ini-file.png)  
5. Increase the value in the line; the size will differ based on what you are trying to accomplish. In my test, it was set to **8M**, which I increased to **32M**. The line looked like this when I was finished: `**post_max_size = 32M**`
6. Click the **Save** button, then refresh your web page. Test what you were doing again, and it should work without the *exceed the post_max_size directive in php.ini* error. If you still get the error, you may have to increase the value to a higher number or make the **php.ini** file *[recursive](https://www.inmotionhosting.com/support/website/recursive-php-ini/)*.

Congratulations, now you know how to fix the “*uploaded file may exceed the post_max_size directive in php.ini*” error in Moodle!
