I had uploaded three files to the server in php. Smaller files are uploaded correctly but when uploading larger files I get an error.
How to upload large files in php?
I had uploaded three files to the server in php. Smaller files are uploaded correctly but when uploading larger files I get an error.
How to upload large files in php?
You have to set your php.ini to accept larger file size: you are interested in two variables i think:
Look here for reference
If the smaller files are uploaded successfully but not the larger files, then most probably the problem is caused by the php.ini settings.
Did you check what is Maximum allowed size for uploaded files defined in your php.ini file? Find the following line in your php.ini file, there you can define the size. For example:
increase the memory limit with .htaccess or
ini_set()
function in phpAs Nicola points out, there are some variables in the php.ini you should look for:
For example, in php.ini:
What Nicola didn't mention is that constraints may also be in place on your web server. If it's
nginx
for example, you need to make adjustments to the configuration of your virtual host to support larger files ...For nginx:
For Apache: