Skip to content
PHP Logo

How can the "upload_max_filesize" and "post_max_size" PHP configuration settings affect file uploads?

The "upload_max_filesize" and "post_max_size" PHP configuration settings determine the maximum size of files that can be uploaded through a form. If these settings are too low, users will encounter errors when trying to upload larger files. To fix this issue, you can increase the values of these settings in your PHP configuration file to allow for larger file uploads.

php
// Increase maximum file upload size
ini_set('upload_max_filesize', '20M');
ini_set('post_max_size', '25M');