Page 1 of 1

error_log_php more than 5 MB

Posted: 01 Nov 2024, 06:19
by failax
Hello, my site is annamariapierangeli.com and my provider sent me this email:

"Dear Customer,
We have detected that in your hosting account there are error files for php (error_log_php) larger than 5 Mb. Given the size, it is highly probable that there are repeated errors on your site that could compromise its usability. We also remind you that this file is included in the disk quota of your account.
Please check and provide a solution.
The domain annamariapierangeli.com has the file /home2/nzannama/error_log_php of size 5 Mb"

I don't know what can I check..

Thanks

Re: error_log_php more than 5 MB

Posted: 01 Nov 2024, 23:17
by mjau-mjau
Hello. You can send me the log file to karl @ photo.gallery? I will check it.

It doesn't necessarily mean anything is wrong if you have a large populated PHP "error" log. It might be full of warnings about deprecated functions, depending on what PHP version you are using.

Re: error_log_php more than 5 MB

Posted: 02 Nov 2024, 07:00
by failax
mjau-mjau wrote: Hello. You can send me the log file to karl @ photo.gallery? I will check it.

It doesn't necessarily mean anything is wrong if you have a large populated PHP "error" log. It might be full of warnings about deprecated functions, depending on what PHP version you are using.
I wrote you an email.Thanks

Re: error_log_php more than 5 MB

Posted: 03 Nov 2024, 00:01
by mjau-mjau
Ok, so I checked the error log, and you basically have 25.000 lines like this:
Code
[27-Oct-2024 00:00:44 Europe/Rome] PHP Deprecated:  DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home2/nzannama/public_html/app/parsers/Twig/Extension/Core.php on line 542
So first of all, this is entirely harmless, as it's just a "deprecated" message not technically an error. "Deprecated" means that your upgraded PHP version 8.2.24 no longer accepts "null" values for DateTime(). It seems you have PHP error logging set unusually high in your PHP settings somewhere? You don't need to log E_NOTICE and E_DEPRECATED in production websites. Anyway, you can delete the error log entry.

If you want to prevent it from populating in the future, you can either 1. Modify your error reporting, or 2. Open the file /app/parsers/Twig/Extension/Core.php in a text editor, and modify line 542:
Code
// $date = new DateTime($date, $defaultTimezone);
$date = new DateTime($date??'', $defaultTimezone); // use this instead
I'm not quite sure why you are even getting the "deprecated" message, but it could be a corrupted image date entry. I will look into it for next release, but it's definitely harmdless.

Re: error_log_php more than 5 MB

Posted: 03 Nov 2024, 05:35
by failax
mjau-mjau wrote:
If you want to prevent it from populating in the future, you can either 1. Modify your error reporting, or 2. Open the file /app/parsers/Twig/Extension/Core.php in a text editor, and modify line 542:
Code
// $date = new DateTime($date, $defaultTimezone);
$date = new DateTime($date??'', $defaultTimezone); // use this instead
I'm not quite sure why you are even getting the "deprecated" message, but it could be a corrupted image date entry. I will look into it for next release, but it's definitely harmless.
I made this change, I'll let you know.Thanks

Re: error_log_php more than 5 MB

Posted: 20 Dec 2024, 02:31
by mjau-mjau
This was fixed in latest release X3.34.0.
https://www.photo.gallery/blog/photo-gallery-x3-34/

Re: error_log_php more than 5 MB

Posted: 20 Dec 2024, 05:09
by failax
mjau-mjau wrote: This was fixed in latest release X3.34.0.
https://www.photo.gallery/blog/photo-gallery-x3-34/
I've just installed the update, thanks!