Welcome Guest, Not a member yet? Register   Sign In
Cannot install PHP intl extension (CI4 MacOS)
#1

Hi everyone! Smile 
Hope that you are doing well.

I am trying to run CI 4 on my machine. 
OS: Mac OS Big Sur 11.6.1. 
PHP: 7.4.27
XAMPP: 7.4.27

I am currently getting the following error: 

Code:
Fatal error: Uncaught Error: Call to undefined function CodeIgniter\locale_set_default() in /Applications/XAMPP/xamppfiles/htdocs/ecms/system/CodeIgniter.php:184 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/ecms/system/bootstrap.php(181): CodeIgniter\CodeIgniter->initialize() #1 /Applications/XAMPP/xamppfiles/htdocs/ecms/public/index.php(38): require('/Applications/X...') #2 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/ecms/system/CodeIgniter.php on line 184

As far as I understood we should remove the semicolon before extension=intl in the php.ini file. Unfortunately, that is not my solution. 

I guess I cannot install the intl extension properly.

https://prnt.sc/yJWf2XxgqxK0

As you can see from here grep function find it but when I try to install it again an error is thrown.

https://prnt.sc/dNG4b2IVaM3g



Kind Regards,
Ivo
Reply
#2

Hi everyone,
I managed to fix the issue thanks to crsss (https://community.apachefriends.org/f/vi...29&t=75044)






Code:
Hi,

you have to build intl-extension from php source code on your own. If you have some experiences using the terminal it won't be hard to do.

First make sure you installed Xcode and started it at least once to finish installation and accept license agreement.
Download latest version of autoconf from http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz. Its a prerequisite to build php modules which is not shipped with macOS.
Extract the file and open a terminal in macOS and open the extracted folder using cd command.
Afterwards use commands:
./configure
make
sudo make install (your password is required, make sure you are an admin user in macOS)

Download the version of php you use in xampp from php.net.
Extract it and open the extracted folder in a terminal using cd.
Change to subfolder ext/intl.
Run these commands to build the extension:
/Applications/XAMPP/bin/phpize
./configure --enable-intl --with-php-config=/Applications/XAMPP/bin/php-config --with-icu-dir=/Applications/XAMPP/xamppfiles/
make
sudo make install (password required)
Delete all files you downloaded and also the extracted folders.
Add to php.ini file in xampp/etc folder line
extension="intl.so"

Since intl-extension has to be compiled anew each time you installed a new version of xampp I wrote a shell script to do this for me.

Regards,
Chris
Reply




Theme © iAndrew 2016 - Forum software by © MyBB