2

I'm trying to install intl on Mac os Ventura 13.0.1 with XAMPP 8.1.12 with pecl with this command:

sudo /Applications/XAMPP/xamppfiles/bin/pecl install intl

i cannot use directly pecl because i've also other installed php version.

Obviously i've already installed icu4c with command:

brew install icu4c

Here's result of brew list icu4c

/opt/homebrew/Cellar/icu4c/71.1/bin/derb
/opt/homebrew/Cellar/icu4c/71.1/bin/genbrk
/opt/homebrew/Cellar/icu4c/71.1/bin/gencfu
/opt/homebrew/Cellar/icu4c/71.1/bin/gencnval
/opt/homebrew/Cellar/icu4c/71.1/bin/gendict
/opt/homebrew/Cellar/icu4c/71.1/bin/genrb
/opt/homebrew/Cellar/icu4c/71.1/bin/icu-config
/opt/homebrew/Cellar/icu4c/71.1/bin/icuexportdata
/opt/homebrew/Cellar/icu4c/71.1/bin/icuinfo
/opt/homebrew/Cellar/icu4c/71.1/bin/makeconv
/opt/homebrew/Cellar/icu4c/71.1/bin/pkgdata
/opt/homebrew/Cellar/icu4c/71.1/bin/uconv
/opt/homebrew/Cellar/icu4c/71.1/include/unicode/ (189 files)
/opt/homebrew/Cellar/icu4c/71.1/lib/libicudata.71.1.dylib
/opt/homebrew/Cellar/icu4c/71.1/lib/libicui18n.71.1.dylib
/opt/homebrew/Cellar/icu4c/71.1/lib/libicuio.71.1.dylib
/opt/homebrew/Cellar/icu4c/71.1/lib/libicutest.71.1.dylib
/opt/homebrew/Cellar/icu4c/71.1/lib/libicutu.71.1.dylib
/opt/homebrew/Cellar/icu4c/71.1/lib/libicuuc.71.1.dylib
/opt/homebrew/Cellar/icu4c/71.1/lib/icu/ (4 files)
/opt/homebrew/Cellar/icu4c/71.1/lib/pkgconfig/ (3 files)
/opt/homebrew/Cellar/icu4c/71.1/lib/ (18 other files)
/opt/homebrew/Cellar/icu4c/71.1/sbin/escapesrc
/opt/homebrew/Cellar/icu4c/71.1/sbin/genccode
/opt/homebrew/Cellar/icu4c/71.1/sbin/gencmn
/opt/homebrew/Cellar/icu4c/71.1/sbin/gennorm2
/opt/homebrew/Cellar/icu4c/71.1/sbin/gensprep
/opt/homebrew/Cellar/icu4c/71.1/sbin/icupkg
/opt/homebrew/Cellar/icu4c/71.1/share/icu/ (4 files)
/opt/homebrew/Cellar/icu4c/71.1/share/man/ (15 files)

Now once i try to install intl with pecl i got this error:

 cc -I. -I/private/var/tmp/pear/temp/intl -I/private/var/tmp/pear/temp/pear-build-rootQBIGcB/intl-3.0.0/include -I/private/var/tmp/pear/temp/pear-build-rootQBIGcB/intl-3.0.0/main -I/private/var/tmp/pear/temp/intl -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/lib -I/include -DHAVE_CONFIG_H -g -O2 -Wno-write-strings -DZEND_COMPILE_DL_EXT=1 -c /private/var/tmp/pear/temp/intl/php_intl.c -MMD -MF php_intl.dep -MT php_intl.lo  -fno-common -DPIC -o .libs/php_intl.o
In file included from /private/var/tmp/pear/temp/intl/php_intl.c:25:
In file included from /private/var/tmp/pear/temp/intl/php_intl.h:32:
/private/var/tmp/pear/temp/intl/collator/collator_sort.h:23:76: error: expected ')'
typedef int (*collator_compare_func_t)( zval *result, zval *op1, zval *op2 TSRMLS_DC );
                                                                           ^
/private/var/tmp/pear/temp/intl/collator/collator_sort.h:23:39: note: to match this '('
typedef int (*collator_compare_func_t)( zval *result, zval *op1, zval *op2 TSRMLS_DC );
                                      ^
In file included from /private/var/tmp/pear/temp/intl/php_intl.c:25:
/private/var/tmp/pear/temp/intl/php_intl.h:33:10: fatal error: 'unicode/ubrk.h' file not found
#include <unicode/ubrk.h>
         ^~~~~~~~~~~~~~~~
2 errors generated.
make: *** [php_intl.lo] Error 1
ERROR: `make' failed

Once i start the install intl the script ask me:

Specify where ICU libraries and headers can be found [DEFAULT] :

i simple hint enter and got same error but i've also tried to use:

/opt/homebrew/Cellar/icu4c/71.1/include/unicode/

but same error appear

I'm loosing my mind with this problem!!

2
  • Have you exported the library include path? See stackoverflow.com/questions/66844482/… Commented Jan 3, 2023 at 16:30
  • If you speak about this: export CPPFLAGS=-I/usr/local/Cellar/icu4c/69.1/include/ export LDFLAGS=-L/usr/local/Cellar/icu4c/69.1/lib YEs i confirm that i've try same result once i ran install install intl Commented Jan 3, 2023 at 16:32

1 Answer 1

4

After having struggled with this for a long while, I finally got it to work.

XAMPP must be in your path, as invoking its phpize command will be needed.

First, issue a php --version from a terminal to determine the exact PHP version provided by your XAMPP installation. For me, it is 8.2.4. Download the PHP archive matching this version from the following page : https://www.php.net/releases/index.php (that is, for me, the exact link is https://www.php.net/distributions/php-8.2.4.tar.gz)

Now type the following commands:

$ cd
$ tar xzf php-8.2.4.tar.gz
$ cd php-8.2.4/ext/intl
$ phpize
$ ./configure --enable-intl --with-php-config=/Applications/XAMPP/bin/php-config
$ make
$ sudo make install

The last command copies the newly built intl.so file to your XAMPP php extensions folder.

Edit /Applications/XAMPP/etc/php.ini and make sure intl is enabled:

extension=intl.so

Restart Apache.

Sign up to request clarification or add additional context in comments.

1 Comment

I am getting the error (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')) because XAMPP seems to be build in x86_64. The problem, how do I solve this. If I follow the steps with "arch -x86_64" command, it also doesn't work. Any ideas?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.