It seems like you are indeed running into an issue with PHP's post_max_size setting, which limits the size of POST data that PHP will accept. Since your post_max_size is set to 8MB and you are trying to upload a 20MB file, you will need to increase this limit.
To resolve this issue, you will need to adjust both post_max_size and upload_max_filesize in your PHP configuration. Here's how you can do it in Herd:
-
Locate the PHP Configuration File (php.ini):
- Herd should have a specific php.ini file for its environment. You can typically find this file in the directory where PHP is installed, or within a conf or config directory inside the Herd environment.
-
Modify the php.ini File:
- Open the php.ini file in a text editor.
- Search for
upload_max_filesizeandpost_max_size. - Set their values to a limit higher than the size of the file you are trying to upload. For example, if you are uploading a 20MB file, you might set both to
25M. - It should look something like this:
upload_max_filesize = 25M post_max_size = 25M
-
Restart the Server:
- After making these changes, make sure to restart your Herd server so that the new configuration settings take effect.
-
Verify Changes:
- You can verify that the changes have been applied by creating a simple PHP file with the following content and navigating to it in your browser:
<?php phpinfo(); - Look for
upload_max_filesizeandpost_max_sizein the output to confirm they are set to the new values.
- You can verify that the changes have been applied by creating a simple PHP file with the following content and navigating to it in your browser:
Here is a simple example of how you might adjust the settings in your php.ini file:
; Maximum allowed size for uploaded files.
upload_max_filesize = 25M
; Must be greater than or equal to upload_max_filesize
post_max_size = 25M
After making these changes and restarting your server, try uploading the file again. This should resolve the "Content too large" error you are encountering.