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, you must modify the size of the uploaded file in multiple places to solve the problem. The following are some documents.
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.