For some websites in nginx + php, the size of the uploaded files is limited in many ways. one is the size of the files uploaded by nginx, which is limited by the size of the files uploaded by the client. The other is php. by default, the INI file has settings in multiple locations. Therefore, to solve the problem of file size limitation
max_execution_time = 300max_input_time = 600
I have already discussed how to solve the php file upload size limit in apache + php. For nginx + php websites, the difference from how to solve the php file upload size limit in apache + php is the nginx restrictions, which limit the size of files uploaded by the client, nginx is used as an example to illustrate how to solve this problem in nginx + php.
1. modify nginx configuration items
Modify the/usr/local/nginx/conf/nginx. conf file to find the client_max_body_size file and set the value to be set. For example:
Location ~ \. Php $ {root/home/www/htdocs; fastcgi_pass www.169it.com; fastcgi_index index. php; fastcgi_param SCRIPT_FILENAME/home/www/htdocs $ fastcgi_script_name; include fastcgi_params; limit 10 m; # set the size of the uploaded file on the client to bytes/home/www/nginx_temp}
2. modify php configuration items
You also need to modify php according to the actual situation. max_execution_time (maximum execution time of php pages), max_input_time (maximum time for receiving data on php pages), and memory_limit (maximum memory occupied by php pages) in the ini configuration file), upload_max_filesize, and post_max_size.
Modify the php. ini configuration file
upload_max_filesize = 20Mpost_max_size = 30Mmemory_limit = 256M
If the file is too large, there may be time issues. if necessary, make the following changes:
max_execution_time = 300max_input_time = 600
The above content is the article about modifying the configuration to truly solve the php file upload size limit (nginx + php). I hope you will like it.