The error “Too big POST data. Reduce the data or increase the ‘post_max_size’ configuration directive.” typically occurs when a web server is receiving a POST request with data larger than the allowed limit. This limit is controlled by the post_max_size
directive in the PHP configuration. Here’s how to fix it on an Ubuntu server:
You need to increase the post_max_size
value in your PHP configuration file.
/etc/php/{version}/apache2/php.ini
for Apache or /etc/php/{version}/fpm/php.ini
for Nginx. Replace {version}
with your installed PHP version (e.g., 7.4
, 8.0
).sudo nano /etc/php/{version}/apache2/php.ini
post_max_size
directive:post_max_size
directive in the file.post_max_size = 8M
Increase the value as needed, for example:
post_max_size = 20M
This increases the allowed POST data size to 20 MB. Adjust this value according to your needs.
CTRL + X
, then Y
, and Enter
to save the changes and exit the editor.upload_max_filesize
If your application is uploading files, you might also need to increase the upload_max_filesize
directive to match or exceed post_max_size
.
upload_max_filesize = 20M
After making these changes, restart your web server to apply the new settings.
sudo systemctl restart apache2
sudo systemctl restart php{version}-fpm sudo systemctl restart nginx
Replace {version}
with your PHP version (e.g., 7.4
, 8.0
).
You can verify the new settings by creating a PHP file with phpinfo()
or checking your application to see if the error is resolved.
By following these steps, you should be able to fix the “Too big POST data” error on your Ubuntu server.