# Pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- #
- Location ~ \.php$ {
- Root/home/www/htdocs;
- Fastcgi_pass 127.0.0.1:9000;
- Fastcgi_index index.php;
- Fastcgi_param Script_filename/home/www/htdocs$fastcgi_script_name;
- Includefastcgi_params;
Client_max_body_size 35m; #客户端上传文件大小设为35M
- Client_body_temp_path/home/www/nginx_temp; #设置临时目录
- }
Copy Code2, modify php.ini in the php.ini view:
- Upload_max_filesize = 8M
- Post_max_size = 10M
- Memory_limit = 20M
- max_execution_time=300
- File_uploads = On
Copy CodeHTTP file uploads are allowed by default, and this option cannot be set to OFF. Upload_tmp_dir =/tmp/www When uploading large files, there will be slow upload feeling, when more than a certain time, will report the script to execute more than 30 seconds of error, modify the changes in the php.ini configuration file max_execution_time configuration options, which represents the maximum allowable execution time per script (in seconds), 0 means there is no limit. The value of the max_execution_time can be adjusted appropriately and is not recommended to be set to 0. Complete the above two changes, basically can solve the PHP upload file size limit problem. |