Fix “uploaded file may exceed the post_max_size directive in php.ini” Updated on March 31, 2023 by InMotion Hosting Contributor 1 Minutes, 28 Seconds to Read 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 from the Moodle Admin Dashboard. Fixing the “exceed the post_max_size directive” error Login to cPanel. Click the File Manager button in the Files section. If the Directory Selection window pops up, click the Go button. 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. 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) 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 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. Congratulations, now you know how to fix the “uploaded file may exceed the post_max_size directive in php.ini” error in Moodle! Share this Article IC InMotion Hosting Contributor Content Writer InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals! More Articles by InMotion Hosting Related Articles How to install Moodle using Fantastico Installing Moodle with Softaculous How to Add Content Security Policy in Moodle With the Local CSP Plugin Inserting an image slider in Moodle Changing the Moodle admin password through PhpMyAdmin Fix “uploaded file may exceed the post_max_size directive in php.ini” How to Add the Quiz Module in Moodle Adding the File Resource Module to Moodle Courses Integrate Jitsi with Moodle Courses How to Install a Plugin in Moodle
You should also mention that the upload_max_filesize should be less than or equal to that of the post_max_size for it to work.