A
A
alexandrnevajno12018-02-26 11:17:27
PHP
alexandrnevajno1, 2018-02-26 11:17:27

Why is the ini_set in the project set on a certain event? Is it correct?

Hello. I understand other people's code. And here in the photo upload function there are these lines:

ini_set('max_execution_time', 90);
ini_set("max_input_time", 600);

I have a question. After all, these functions change the parameters of not just one file, but the entire project as a whole, don't they? And they change for all the time, and not for the time of a specific operation?
Why are they written in the file load function and not when the project starts? Is this correct or is it a programmer's mistake?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Nick Sdk, 2018-02-26
@lidacriss

And they change for all the time, and not for the time of a specific operation?

They change just for a while, and not for "always"
This is necessary in the case when we need to download something that takes a long time to load and so that the script does not disappear due to timeout

S
synapse_people, 2018-02-26
@synapse_people

> And change for all the time, and not for the duration of a specific operation?
Is there no way to return the previous values?
In general, this is not correct, but it cannot be called a mistake either.

B
bkosun, 2018-02-26
@bkosun

Sets the value of the specified configuration setting. The setting will store the set value while the script is running. After the script ends, the setting value will return to the original.

php.net/manual/en/function.ini-set.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question