To increase the upload file size limit in PHP, you can modify the upload_max_filesize
and post_max_size
directives in the php.ini
configuration file. Here are the steps you can follow to increase the upload file size limit in PHP:
Find the location of the php.ini
file:
The php.ini
file is the main configuration file for PHP. To find its location, you can use the phpinfo
function to display the path to the file:
<?php phpinfo(); ?>
Save the file as phpinfo.php
and place it in your web server's document root. Then, access the file in a web browser to view the PHP information page.
Look for the "Loaded Configuration File" setting in the PHP information page. The path to the php.ini
file will be listed under this setting.
Modify the upload_max_filesize
and post_max_size
directives:
Open the php.ini
file in a text editor and locate the upload_max_filesize
and post_max_size
directives.
Increase the values of these directives to the desired file size limit. For example, to increase the file size limit to 100 MB, you can set the directives as follows:
upload_max_filesize = 100M post_max_size = 100M
Save the changes to the php.ini
file.
Restart the web server:
After modifying the php.ini
file, you will need to restart the web server for the changes to take effect.