Welcome Guest, Not a member yet? Register   Sign In
Can't run codeigniter 4 on macOS Sonoma (v14.4.1)

Hi everyone. I am trying to install CodeIgniter 4 on my MacBook Pro M1. I started by installing XAMPP, then I installed Composer, and afterwards, I enabled the extensions required in the official documentation. Everything went smoothly until I tried to view my project at localhost/project-name/public. I am receiving the following error: Class "Locale" not found on the following function:

public function initialize()
    // Set default locale on the server
    Locale::setDefault($this->config->defaultLocale ?? 'en'); //ERROR IS HERE

    // Set default timezone on the server
    date_default_timezone_set($this->config->appTimezone ?? 'UTC');

I already check if intl extension is enabled by typing this command:      
php -m | grep intl

And it returns "intl". Does anyone knows what might be? Do i need to check something in particulary?

(This post was last modified: 05-25-2024, 10:46 PM by kenjis.)

Don't use XAMPP for Mac.
XAMPP does not have intl. If you use XAMPP, you need to compile intl.so by yourself.

If `php -m | grep intl` returns intl, the cli php command works.
Run `php spark serve` at the root directory of your project.

@kenjis, XAMPP for Windows does have the intl extension.

Guess for Mac they left it out.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

@InsiteFX Oh, yes. I meant XAMPP for Mac.
I found this thread:

Do you guys have a simple guide about how to perform a clean install on mac using MAMP? Do I need to install other things a part composer ? Thanks

To be able to work on MacOs Sonoma you can read my post (or even the whole story if you want). Now, I can use phpmyadmin, I don't need to use DbGate but please read this one first and follow the last page, my last post for the exact solution.
I enjoy web design   d-templates.com

Theme © iAndrew 2016 - Forum software by © MyBB