Home  >  Article  >  Backend Development  >  How to set php parameters

How to set php parameters

藏色散人
藏色散人Original
2020-11-25 09:43:182919browse

How to set php parameters: first find and open the "php.ini" file; then set the value of "max_execution_time" to 30; then modify the value of "max_input_time" to 60; finally save the changes.

How to set php parameters

The operating environment of this tutorial: Windows 7 system, PHP version 5.6. This method is suitable for all brands of computers.

Recommended: "PHP Video Tutorial"

Settings of several parameters in php.ini

Table 1. Resource-related settings in php.ini

##SettingsDescriptionRecommendations Valuemax_execution_timeHow many CPU seconds a script can use30max_input_timeHow long (in seconds) a script waits for input data60memory_limitHow long a script can wait before being canceled How much memory (bytes) is used32Moutput_bufferingHow much data (bytes) needs to be buffered before the data is sent to the client4096
The exact number depends mainly on your application. If you are receiving large files from the user, then

max_input_time may have to be increased, either by modifying it in php.ini or by overriding it in code. Similarly, programs that are more CPU or memory intensive may require larger settings. The goal is to mitigate the effects of excessive programs, so disabling these settings globally is not recommended. One more thing to note about max_execution_time: it represents the CPU time of the process, not the absolute time. So a program that does a lot of I/O and a little computation may run far longer than max_execution_time. This is why max_input_time can be greater than max_execution_time.

The above is the detailed content of How to set php parameters. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn