I have this part of code:
...
ini_set('max_execution_time', 300);
...
Until now it worked. Now i am getting this error:
ini_set() expects parameter 2 to be string, integer given
What has changed? Can it be caused by PHP version?
I have this part of code:
...
ini_set('max_execution_time', 300);
...
Until now it worked. Now i am getting this error:
ini_set() expects parameter 2 to be string, integer given
What has changed? Can it be caused by PHP version?
3
Answers
Not sure how it was working for you. Here is the reference. Second parameter needs to be string data type.
Maybe you was using a variable to set it until now and that variable was somehow getting casted to string? not sure.
Anyways, just use string instead of an integer as second parameter:
and you should be good.
Weird enough, just now i noticed, giving second parameter as integer is working on my Server.
Also Here, if you search with “ini_set”, the example is given with second parameter as integer:
It is weird why its not working for you.
PHP actually expects both parameters of
ini_set()
to be of typestring
and returns astring
:You can find this in the PHP manual on
ini_set
.If you have set
strict_types
withthen you will have to change your
ini_set()
values toPHP accept the key value pair in string in PHP ini_set().