您好,欢迎访问一九零五行业门户网

PHP与Nginx文件上传大小限制如何解决

# 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;#设置临时目录}
复制代码
2、修改php.ini在php.ini中查看:
upload_max_filesize = 8m post_max_size = 10m memory_limit = 20mmax_execution_time=300file_uploads = on
复制代码
默认允许http文件上传,此选项不能设置为off。upload_tmp_dir =/tmp/www
在上传大文件时,会有上传速度慢的感觉,当超过一定的时间,会报脚本执行超过30秒的错误,修改修改在php.ini配置文件中max_execution_time配置选项,其表示每个脚本最大允许执行时间(秒),0 表示没有限制。
可以适当调整max_execution_time的值,不推荐设定为0。
完成以上二处的修改,基本上就可以解决php上传文件大小限制的问题了。
其它类似信息

推荐信息