Welcome Guest, Not a member yet? Register   Sign In
After deployment: Error: Class "CodeIgniter\I18n\Time" not found
#1

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.
Reply
#2

(This post was last modified: 01-30-2025, 02:31 PM by captain-sensible.)

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
CMS CI4 A CMS system, runs out of the box written on top of CI4
Arch Book  CodeIgniter4 on Apache(pages 92-114) 
Reply
#3

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.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB