Welcome Guest, Not a member yet? Register   Sign In
fatal logger emergency
#1

a clean install of 4.5.1 runs perfectly on my local system but when i copy it to the remote it crashes immediately. both systems are using php8.1
a similar application running on the same host but using 4.3.3 runs perfectly

PHP Code:
Fatal errorDeclaration of CodeIgniter\Log\Logger::emergency(Stringable|string $message, array $context = []): void must be compatible with PsrExt\Log\LoggerInterface::emergency($message, array $context = []) in /var/www/vhosts/53/149679/webspace/siteapps/vendor/codeigniter4/framework/system/Log/Logger.php on line 162

Fatal error
Uncaught Error: Class "CodeIgniter\Log\Logger" not found in /var/www/vhosts/53/149679/webspace/siteapps/vendor/codeigniter4/framework/system/Config/Services.php:403 Stack trace#0 /var/www/vhosts/53/149679/webspace/siteapps/vendor/codeigniter4/framework/system/Config/BaseService.php(311): CodeIgniter\Config\Services::logger(false) #1 /var/www/vhosts/53/149679/webspace/siteapps/vendor/codeigniter4/framework/system/Config/BaseService.php(250): CodeIgniter\Config\BaseService::__callStatic('logger', Array) #2 /var/www/vhosts/53/149679/webspace/siteapps/vendor/codeigniter4/framework/system/Config/Services.php(400): CodeIgniter\Config\BaseService::getSharedInstance('logger') #3 /var/www/vhosts/53/149679/webspace/siteapps/vendor/codeigniter4/framework/system/Config/BaseService.php(311): CodeIgniter\Config\Services::logger() #4 /var/www/vhosts/53/149679/webspace/siteapps/vendor/codeigniter4/framework/system/Config/BaseService.php(201): CodeIgniter\Config\BaseService::__callStatic('logger', Array) #5 /var/www/vhosts/53/149679/webspace/siteapps/vendor/codeigniter4/framework/system/Common.php(998): CodeIgniter\Config\BaseService::get('logger') #6 /var/www/vhosts/53/149679/webspace/siteapps/vendor/codeigniter4/framework/system/Common.php(785): service('logger') #7 /var/www/vhosts/53/149679/webspace/siteapps/vendor/codeigniter4/framework/system/Debug/Exceptions.php(140): log_message('critical', 'ErrorException:...', Array) #8 /var/www/vhosts/53/149679/webspace/siteapps/vendor/codeigniter4/framework/system/Debug/Exceptions.php(252): CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ErrorException)) #9 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler() #10 {main} thrown in /var/www/vhosts/53/149679/webspace/siteapps/vendor/codeigniter4/framework/system/Config/Services.php on line 403 

many thnaks for any help, Bill
Reply
#2

so i just came across this thread which is the same problem https://forum.codeigniter.com/showthread.php?tid=90682
Kenjis wrote "remove the extension, it is outdated" and gave a link to github but the link is for installing.
there was no answer to the final question "how do i remove it?"
can somebody PLEASE tell me how to cure the fault? I'm completely stuck
thanks Bill
Reply
#3

Remove the line in your php.ini:
extension=psr.so
Reply
#4

It's ok, sometimes (all too often) my mind goes into a spin and I can't see the wood for the trees. I finally realised what you meant was not removing something from the cig installation but changing the server setup. It's working fine on my local computer but not on the remote and that is not under my control. They've told me if I move the hosting to one of their newer computers the problem will go away so I'll do today.
Thanks for the help
Bill
Reply
#5

(05-13-2024, 04:09 PM)kenjis Wrote: Remove the line in your php.ini:
extension=psr.so

It that extension incompatible with CI 4.5.x? 

I have not yet moved any of my projects to 4.5

Bruce
Reply
#6

(05-14-2024, 03:32 AM)Bosborne Wrote:
(05-13-2024, 04:09 PM)kenjis Wrote: Remove the line in your php.ini:
extension=psr.so

It that extension incompatible with CI 4.5.x? 

Yes, incompatible.
CI 4.5.x requires psr/log v3.0.0.
Reply
#7

I spent hours trying to solve this issue. its was a pain.

please remove the PSR extension you installed , even if you didn't install it manually, just remove it

sudo apt remove php8.2-psr
sudo systemctl reload apache2.service

just remove the extension for the version of php you are running, then reload apache or your webserver
Reply
#8

(This post was last modified: 06-13-2024, 02:18 AM by JustJohnQ. Edit Reason: Additional info )

I have the same problem when upgrading 4.4.8 to 4.5.0 on Windows ssytem running WAMP. PHP version is 8.3.8.
I replaced the SYSTEM folder and replaced both public\index.php and spark.
There is no sign of a psr extesion in php.ini.
What else could be wrong?

A fresh installation of CI 4.5.1 runs without problems on the same system.
Reply
#9

(06-13-2024, 02:15 AM)JustJohnQ Wrote: A fresh installation of CI 4.5.1 runs without problems on the same system.

If v4.5.1 works, you never have installed the PSR extension.
So the error message would be a bit different.

If you have installed "psr/log" v1 with Composer, you would probably get similar error.
Reply
#10

Thanks kenjis. I (manually) updated the vendor\psr\log\ to the latest version and the error messages are gone now.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB