简体   繁体   中英

Upload Large File by PHP

Here is my phpinfo()

https://devmail.equidesk.com/phpinfo.php

I can't upload more than 2MB file by php. I increased upload limit in php.ini but it's not working.

see this: Change the maximum upload file size

you should change php.ini

upload_max_filesize = 10M

post_max_size = 10M

And if you use nginx, should change nginx.conf file

like this.

server {
    client_max_body_size 10M;

    //other lines...
}

If you changed server configurations, you should restart fpm and nginx.

sudo service nginx restart
sudo service php5-fpm restart

Value of your upload_max_filesize attribute is 2M . Thats why you are unable to upload more than 2M .

You need to increase size of upload_max_filesize in php.ini file. After that you will be able to upload large file.

You can change it to 128M or 256M whatever you want depends upon size of your upload file.

upload_max_filesize in phpinfo still showing 2M

Change this and restart server

post_max_size = 250M 
upload_max_filesize = 250M 
max_execution_time = 5000
max_input_time = 5000  
memory_limit = 1000M

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM