1

This is the error I see in CodeIgnitor 4 on a new server installation.

Fatal error: Uncaught Error: Call to undefined function CodeIgniter\locale_set_default() 

When I look at potential problems I see that I have the intl extension installed but when I do this command:

    php -i | grep -i intl

returns

    intl.default_locale => no value => no value
Barry
  • 3,303
  • 7
  • 23
  • 42
jbrahy
  • 4,228
  • 1
  • 42
  • 54

2 Answers2

3

In addition to adding an actual locale like this in php.ini file:

intl.default_locale="en-US"

ensure that this extension is enabled... in other words remove the ; in this line...

extension=php_intl.dll

and after a restart this fixed for me.

Barry
  • 3,303
  • 7
  • 23
  • 42
1

So the solution I've found is to edit the PHP configuration files and add:

   intl.default_locale="en-US"

I added it to /etc/php.d/20-intl.ini but your local configuration may vary.

Then I tested the apache configuration and restarted:

    apachectl configtest
    apachectl restart

The error didn't go away so I continued my search and found php-fpm was running:

    ps auxwww | grep -i PHP 

which returned

apache   10499  0.0  0.4 292148 16672 ?        S    17:07   0:00 php-fpm: pool www
apache   10502  0.0  0.4 292148 16696 ?        S    17:07   0:00 php-fpm: pool www
apache   10503  0.0  0.3 290076 13756 ?        S    17:07   0:00 php-fpm: pool www
apache   10504  0.0  0.3 290076 13768 ?        S    17:07   0:00 php-fpm: pool www
apache   10506  0.0  0.2 288028 11624 ?        S    17:07   0:00 php-fpm: pool www
apache   20201  0.0  0.3 290076 13744 ?        S    17:16   0:00 php-fpm: pool www

so I restarted that service with this command:

    service php-fpm restart

and now everything seems to be running perfectly. There were still a few permissions issues to address with a new install of CodeIgnitor but those are for another post.

jbrahy
  • 4,228
  • 1
  • 42
  • 54