Home  >  Article  >  Backend Development  >  How to modify response time in php

How to modify response time in php

藏色散人
藏色散人Original
2021-02-23 09:33:293412browse

How to modify the response time of php: First find and open the "php.ini" configuration file; then find the "max_execution_time" and "max_input_time" parameters and modify them.

How to modify response time in php

#The operating environment of this article: Windows7 system, PHP7.1, Dell G3 computer.

Modify php upload file size, response time, time zone time and other settings

Modify php upload file size, response time

1. Modify php. ini

1. post_max_size refers to the maximum value that can be received by PHP through form POST, including all values ​​​​in the form. The default is 8M (changed to 150M). It depends on what you need to change.

2. First confirm whether file_uploads = on is allowed to upload files through HTTP. The default is ON.

upload_tmp_dir The cache directory for uploading files through HTTP, check whether it is writable;

Look for upload_max_filesize, which is the maximum value of the file size allowed to be uploaded. The default is 2M (changed to 100M).

3. If you want to upload a file >8M, it may not be possible to just set the above four items. It is best to also set the following parameters:

max_execution_time The maximum time value (seconds) for each PHP page to run, the default is 30 seconds (change to 0, no limit).

max_input_time The maximum time required for each PHP page to receive data, default 60 seconds (change to 0, no limit).

memory_limit The maximum memory consumed by each PHP page, the default is 8M (changed to 128M, no limit).

Time zone time

The first method: Set in php.ini: date.timezone=Asia/Shanghai (note not adding single quotes or double quotes)

No. Two methods: ini_set('date.timezone','Asia/Shanghai');

in the program: "PHP Video Tutorial"

The above is the detailed content of How to modify response time in php. 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