8.5.1. now running on a Virtualmin Virtual Server. PHP 8,.1.24 all compatibility matrix conditions met. Seems to run very well. But…
I am getting a massive amount of log spam as below in my php error log:
[15-Feb-2024 09:26:03 UTC] PHP Deprecated: Return type of Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /mydomain.com/public_html/crm/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php on line 134
[15-Feb-2024 09:26:03 UTC] PHP Deprecated: Return type of Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /mydomain.com/public_html/crm/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php on line 144
[15-Feb-2024 09:26:03 UTC] PHP Deprecated: Return type of Symfony\Component\HttpFoundation\Session\Session::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /mydomain.com/public_html/crm/vendor/symfony/http-foundation/Session/Session.php on line 131
[15-Feb-2024 09:26:03 UTC] PHP Deprecated: Return type of Symfony\Component\HttpFoundation\Session\Session::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /mydomain.com/public_html/crm/vendor/symfony/http-foundation/Session/Session.php on line 141
Same 4 lines repeated 1000’s of times.
It looks like some kind of PHP bug.
Can anyone assist in fixing this beofer I run out of log space.
I also cannot upload any images like changing the logo or adding images to products. I can add an image to a user which is weird. When trying to change the logo I get an error popup telling me I need to use a jpeg or png. And of course I am using a png formatted as per the guidelines.
That activity seems to trigger the log spam above. Might be coincidental but seems connected.
So at this point it is of little use as we cannot do basic things like put our product inventory into the platform.
Sorry, I don’t have time for that. But on the upside, there are tons of pages in the internet explaining how to get stack traces from PHP.
It’s also ok if you decide you don’t want to put in that effort - I understand not everybody has the time or the interest in that sort of technical community participation. I was just asking because if you could get it, it would accelerate things.
In public/legacy/config_override.php add the following setting:
$sugar_config['stack_trace_errors'] = true;
If the file doesn’t exist yet, create it with these contents:
<?php
$sugar_config['stack_trace_errors'] = true;
Note that the deprecated errors are surely not the cause of your issues. Those messages are just a warning for future developers, they don’t indicate any current problem with SuiteCRM. I see you have other threads with more issues, focus on those ones.
This is just about reducing log spam, so leave it for when you have your more urgent problems sorted. Good luck
If the original errors are in the SuiteCRM log, that’s where the stack traces will appear, right after the lines you saw before.
If the original errors are in the php_errors.log, then the above setting won’t make a difference, and to get a stack trace you would need other complicated arrangements unless some kind soul would merge this (but I wouldn’t count on it, it’s been waiting since 2020…).