In nginx, an HTTP Error occurs when php + uploadify is used to upload files (up to 1 MB)

Source: Internet
Author: User
Tags chmod file upload form post

For nginx Upload parameters, pay special attention to the client_max_body_size parameter. Otherwise, the request will be interrupted and cannot be accessed by log in php.

Modified the php. Ini file as follows: parameter settings
Whether file_uploads on allows file upload over HTTP. ON is enabled by default.
Upload_tmp_dir-upload the file to the place where the temporary file is stored on the server. If this parameter is not specified, the default temporary folder will be used.
Upload_max_filesize 8 m Wangwen business, that is, the maximum file size allowed to be uploaded. The default value is 2 MB.
Post_max_size 8 m refers to the maximum value that can be received by the form POST to PHP, including all values in the form. The default value is 8 MB.
Description
Generally, after the above four parameters are set, when the network is normal, uploading a large size file of 8 MB can only set the above four items. Unless your network has a high upload speed of 100 MB/s, you must set the following parameters.
Max_execution_time 600 maximum time (in seconds) for running each PHP page. The default value is 30 seconds.
Max_input_time 600 maximum time required for receiving data on each PHP page. The default value is 60 seconds.
Memory_limit 8 m maximum memory consumed by each PHP page. The default value is 8 M.

No effect, because the webserver uses nginx google, and then adds a parameter to nginx conf:

The default value is 1 MB.

Add a sentence in nginx. conf.

Client_max_body_size 30 m;
Restart

30 M indicates the maximum upload size of 30 M.

Note: If you encounter an IO Error when uploading files, check whether the file upload Directory has permissions.

For example, chmod 777 filename

The chmod command can change the permissions of all subdirectories.

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.