Modify PHP Upload size settings

Source: Internet
Author: User

The current document library upload size is the PHP environment to read the server settings, your PHP environment upload limit is how much, here shows how much.

Many users asked me how to modify the size of the upload, I can Baidu a little way, can also be modified according to the following steps:

1. Locate the php.ini file on the server, typically in the PHP installation directory.

2. Search Post_max_size in the php.ini file, generallypost_max_size=2m, that is, each time the post data is 2M, change the value you want,

such as post_max_size=100m.

3. Search Upload_max_filesize in the php.ini file, generallyupload_max_filesize=8m, the upload file size is 8M, change the value you want,

such as upload_max_filesize=50m.

4. Search Max_execution_time in the php.ini file, generallymax_execution_time=30sThe page execution time is 30S, instead of the value you want,

such as max_execution_time=300s.

General post_max_size > Upload_max_filesize, the size of the upload depends on the minimum value.

Max_execution_time is set to 0, does not limit page execution time, when your bandwidth is slow, it is better to set a larger point.


If uploading, also prompt 0 documents upload success, also need to modify Apache or Niginx configuration files, such as Niginx modified as follows
Modify the/usr/local/nginx/conf/nginx.conf file to find Client_max_body_size to set the value you want to set
# 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;
Include Fastcgi_params;

Client_max_body_size 35m; #客户端上传文件大小设为35M
Client_body_temp_path/home/www/nginx_temp; #设置临时目录
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.