Skip to content
PHP Logo

What role does the php.ini file play in determining the maximum file upload size in PHP?

The php.ini file plays a crucial role in determining the maximum file upload size in PHP by setting the values for the `upload_max_filesize` and `post_max_size` directives. To increase the maximum file upload size, you can modify these directives in the php.ini file to a higher value.

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