This is a report from a user that his hosting service has disallowed the PHP set_time_limit() function in PHP 8.1.
https://forum.joomla.org/viewtopic.php?f=808&t=996843
I have looked through the Joomla code and see that most calls are preceded by @ but one instance checks for the existence of the function. What we need to know is whether to treat this as a bug or to advise the user to move to a different hosting service.
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
Note that wordpress will also fail if that function is disabled
I have looked through the Joomla code and see that most calls are preceded by @ but one instance checks for the existence of the function
Is that inconsistent?
Is that inconsistent?
No. If it's accepted that set_time_limit()
is the kind of function that could be disabled (which is very sensible for shared hosting), all instances should be wrapped in in function_exists()
checks while still maintaining error suppression. This is because in PHP 8 calling a disabled function throws an Error
which can not be suppressed, only caught. Previously only a warning was emitted.
so is set_time_limit()
wrapped in function_exists()
? If not is that what is causing the issue?
Yes, that's what's causing the issue.
So why has nobody edited the code in Joomla so thatset_time_limit()
is wrapped in function_exists()
?
Could be it was not reported before that there are issues like this my hoster for example also dont block that. Feel free to create a PR or look where that calles are missing so someone else can take a look and do the PR :)
2cents:
@
to avoid using class_exists()
. Means: Programmers were aware that not all hosts support set_time_limit()
and that it is just a nice-to-have at this code place.set_time_limit()
should have been documented as a technical requirement of J!4.
@
should be replaced in core code at several places.BTW: Using set_time_limit()
at this code place is a bit questionable from my point of view.
... Feel free to create a PR or look where that calles are missing so someone else can take a look and do the PR :)
If I could I would but that is beyond me.
Labels |
Added:
bug
|
Labels |
Added:
PBF
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-08-30 07:39:30 |
Closed_By | ⇒ | brianteeman |
Labels |
Removed:
PBF
|
The host simply does not understand the purpose of that function. Disabling it actually makes the issue they are trying to resolve worse.