CodeIgniter Forums
After deployment: Error: Class "CodeIgniter\I18n\Time" not found - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: After deployment: Error: Class "CodeIgniter\I18n\Time" not found (/showthread.php?tid=92405)



After deployment: Error: Class "CodeIgniter\I18n\Time" not found - Samax - 01-30-2025

Hello! My issue is the following. I want to deploy my CI4 application with PHP-FPM and Apache, but I receive the following error.
Code:
[2025-01-30 13:33:55] CRITICAL: () line : Error: Class "CodeIgniter\I18n\Time" not found
To make it more interesting the following works without any errors or warning:
Code:
php spark serve
And php extension intl is enabled where I deploy the app and I ran composer install too.
Code:
find vendor -name *Time.php

vendor/google/common-protos/src/Type/DateTime.php
vendor/codeigniter4/framework/system/Language/en/Time.php
vendor/codeigniter4/framework/system/I18n/Time.php // <- exists
vendor/ramsey/uuid/src/Type/Time.php
I also granted privilige to the vendor folder, with no effect.


I would appreciate any help.


RE: After deployment: Error: Class "CodeIgniter\I18n\Time" not found - captain-sensible - 01-30-2025

have you got in contoller anywhere:

Code:
use CodeIgniter\I18n\Time;


in base controller i have
Code:
protected $theTime;

public function __construct()
     {
        
        helper (['text','date','uri','html','form','secuity','numner']);
        $this->theTime =now('Europe/London');
        
    }
    
     protected function getTime()
     {
         return $this->theTime;
        
     }

then in any controller

Code:
public function __construct()
                    {
                        parent::__construct();
                        $this->myTime = parent::getTime();
                        $this->myDate= date("d/m/Y",$this->myTime);     
                    }

i dont know what i was thinking at the time , all i had to do was stick time() in a view


RE: After deployment: Error: Class "CodeIgniter\I18n\Time" not found - Samax - 02-02-2025

Thank you for your effort, but finally the problem was the following:

At the staging area PHP 8.4 was being used. After I downgraded it to 8.3 everything worked fine.