XF 2.2 Couple of php errors in XF

Black Tiger

Active member
For some other reason I had a php error log enabled on my domain. Now I found several errors generated by XF core files (and 1 redirection script) and I wonder why.

First the XF core errors. This one I see lots of times
[12-Feb-2021 15:56:23 Europe/Amsterdam] PHP Fatal error:  Uncaught Error: Call to undefined function phpversion() in /home/user/domains/mydomain.org/public_html/index.php:3

Line 3 of index.php is:
$phpVersion = phpversion();
it's an original XF file. I did not edit any core files and we're running php 7.3.x so I don't know why this is occuring.

Found this once or twice:
[12-Feb-2021 16:00:23 Europe/Amsterdam] PHP Fatal error:  Uncaught Error: Call to undefined function time() in /home/user/domains/mydomain.org/public_html/src/XF.php:71

Line 71 of XF.php is:
                self::$time = time();

And I got one from the redirect, so I will post that one in the redirect thread.

Black Tiger

Active member
Hmmz... that would wonder me.

How can I check this? As for time my phpinfo file says this:
date/time support enabled
timelib version 2018.04
"Olson" Timezone Database Version 2020.4
Timezone Database internal
Default timezone Europe/Amsterdam

But this is DATE so I presume I need one called Time then?

Black Tiger

Active member
So I have a ticket about it, but after saying they don't do server support, they very rudely did not give any response anymore.:mad:
At least a minimal response as "sorry, but we still feel it's server related" would have been customer friendly.

Anyway, I won't bother with that ticket anymore due to the customer unfriendly rudeness of not answering in total anymore to the ticket after only declaring is was server related because:
we would be inundated with people reporting the same issue, however, we are not.
not really the best argument at the least.

But I will post it here for others if they encounter this issue.

If you secure admin.php (limit ip access to it) then XF is throwing these odd errors because of bots trying to visit it.
In spite of the fact that in the logs you see things like Get / from the bots.

So I put in admin.php to be disallowed in robots.txt and the errors are gone.

So as I suspected it's both a server and XF issue. Server because I blocked access, XF because it should not throw these incorrect but other errors in the logs and not undeclared phpversion and time functions as it did.