Summary of "limitations" that are often touched by php.ini

Source: Internet
Author: User
Tags form post
Max_execution_time
PHP Maximum execution time, the default value in PHP.ini is 30, that is, after the page executes 30s, the server will directly force the termination of the page execution.

For the General page, 30s enough, but for some need to directly use PHP to perform a large amount of data analysis of the page, you need to adjust the Max_execution_time value according to the efficiency of the page execution, of course, as far as possible to improve your algorithm, to achieve the best page execution efficiency.
Max_input_vars
PHP Maximum number of submission forms (controls), the default value in PHP.ini is 1000, that is, the number of controls (input) contained in a form form post data cannot exceed 1000.

1000 input is not enough? Can you fill it out? You may have such a question, but in the actual programming process I did encounter such a problem: Upload an Excel form document, the use of Phpexcel class library to parse the output to a page to confirm the user, after confirming by "submit data" inserted into the database, Each cell data is stored in form-input (hidden), the number of input is 200 (row) *8 (column) = 1600, the default number is exceeded, and the result is the first 125 data each time the database is inserted.

When I first encountered this problem, I directly output the value of $_post on the page, found that only 125 records, can be determined that the post transmission problems. On the internet to find a few similar problem information, the basic focus on PHP on the post size limit, but in php.ini I found that post_max_size default value is 32m,post a form of data, no matter how much more than 32M, Think the problem should not be the size limit of the post. I was later aware that it might be a restriction on the control and finally found that Max_input_vars is a limitation on the post control. However, I can not find the relevant information of Max_input_vars in the Wamp php.ini of the machine assembly, only add it by myself.

; Maximum input variable nesting level; http://php.net/max-input-nesting-level;max_input_nesting_level = 64max_input_vars = 5000;   //默认1000; Maximum amount of memory a script may consume (128MB); http://php.net/memory-limitmemory_limit = 128M


Upload_max_filesize and Post_max_size
One is the maximum limit for uploading files, and one is the maximum limit for post.

Need to change when uploading large files with PHP post (maximum file value <= upload_max_filesize <= post_max_size), Otherwise the file will upload failed or just upload a portion of the file (for example: Upload a 20M file test.zip,upload_max_filesize only 10M, upload to the server is likely to be a 10M test.zip)
Max_input_time
This variable is a number of seconds to limit the time it takes to receive data by post, get, and the default value is 60, which is 60s.

If your application is running on a low-speed link, you can increase this value to accommodate the additional time that is required to receive the data.

The above describes the "limitations" of the php.ini in the summary, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    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.