PHP modified File Upload Limit method Summary, _php tutorial

Source: Internet
Author: User
Tags php file upload

PHP modified File Upload Limit method Summary,


PHP default upload limit is maximum 2M, want to upload more than this set of files, need to adjust PHP, Apache and other parameters. Below, we briefly describe some of the parameters involved in uploading PHP files:

File_uploads: Whether to allow the switch to upload files over HTTP, the default is on is on.

Upload_tmp_dir:upload_tmp_dir used to explain the PHP upload files placed in a temporary directory, to upload files, you have to ensure that the server does not close the temporary files and have write permissions to the folder, if not specified, PHP uses the system default values.

Upload_max_filesize: The maximum number of file sizes allowed to upload, default is 2M.

Post_max_size: Controls the maximum amount of data PHP can receive in a single form submission using the Post method. If you want to use PHP file upload functionality, you need to change this value to be larger than upload_max_filesize.

Max_input_time: The time to receive data by post, get, and put is limited in seconds. If your application is running on a low-speed link, you need to increase this value to accommodate the additional time it takes to receive the data.

Memory_limit: PHP allows you to define memory usage limits in order to avoid running scripts that use the system's available memory heavily. The Memory_limit variable is used to specify the maximum memory capacity variable that a single script can use memory_limit the value should be appropriately greater than the value of post_max_size.

Max_execution_time:max_execution_time sets the time at which PHP waits for the script to complete before forcing the script to terminate, which is calculated in seconds. This variable is useful when the script enters an infinite loop state. However, this feature also causes the operation to fail when there is a legitimate activity that takes a long time to complete, such as uploading large files. In such cases, you must consider increasing the value of this variable to avoid PHP closing the script when the script is performing some important process.

For Linux hosts, there may also be php.conf files under/etc/httpd/conf.d/access.conf/, which may solve some system file size limitation issues.

The above is the whole content of this article, I hope we can be familiar with the php file upload helpful.

http://www.bkjia.com/PHPjc/980227.html www.bkjia.com true http://www.bkjia.com/PHPjc/980227.html techarticle php Modified File Upload limit method summary, php default upload limit is maximum 2M, want to upload more than this set of files, need to adjust PHP, Apache and other parameters. Below, we briefly ...

  • 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.