mac xampp php 7 intl extension

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

mac xampp php 7 intl extension

Postby gigamike » 14. December 2016 03:40

Hi,

Anyone successfully install mac xampp php 7 intl extension/.so ?

Thanks in advance,

Mike
gigamike
 
Posts: 1
Joined: 14. December 2016 03:37
XAMPP version: 7.0.13
Operating System: mac

Re: mac xampp php 7 intl extension

Postby crsss » 23. January 2017 13:33

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
crsss
 
Posts: 7
Joined: 02. February 2016 02:27
XAMPP version: 7.1.7
Operating System: macOS, Debian

Re: mac xampp php 7 intl extension

Postby stevenc » 25. October 2020 23:25

Running Mac OS Catalina v. 10.15.7
XAMPP 7.4.11 (PHP 7.4.11)

I have used your previous suggestion successfully in the past to get PHP-Intl to function correctly in XAMPP. I just updated to XAMPP 7.4.11, however, and I cannot get PHP-Intl to load. Any suggestions?

Here's the error message from Terminal:

Code: Select all
SLaptop@MacBook-Pro intl % make
/bin/sh /Users/SLaptop/Downloads/php-7.4.11/ext/intl/libtool --mode=compile cc -I@@BITROCK_COMMON_ROOTDIR@@/include  -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 -DU_HIDE_OBSOLETE_UTF_OLD_H=1 -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/Users/SLaptop/Downloads/php-7.4.11/ext/intl -DPHP_ATOM_INC -I/Users/SLaptop/Downloads/php-7.4.11/ext/intl/include -I/Users/SLaptop/Downloads/php-7.4.11/ext/intl/main -I/Users/SLaptop/Downloads/php-7.4.11/ext/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   -c /Users/SLaptop/Downloads/php-7.4.11/ext/intl/collator/collator_sort.c -o collator/collator_sort.lo
 cc -I@@BITROCK_COMMON_ROOTDIR@@/include -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 -DU_HIDE_OBSOLETE_UTF_OLD_H=1 -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/Users/SLaptop/Downloads/php-7.4.11/ext/intl -DPHP_ATOM_INC -I/Users/SLaptop/Downloads/php-7.4.11/ext/intl/include -I/Users/SLaptop/Downloads/php-7.4.11/ext/intl/main -I/Users/SLaptop/Downloads/php-7.4.11/ext/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 -c /Users/SLaptop/Downloads/php-7.4.11/ext/intl/collator/collator_sort.c  -fno-common -DPIC -o collator/.libs/collator_sort.o
/Users/SLaptop/Downloads/php-7.4.11/ext/intl/collator/collator_sort.c:349:26: error:
      use of undeclared identifier 'TRUE'
        collator_sort_internal( TRUE, INTERNAL_FUNCTION_PARAM_PASSTHRU );
                                ^
/Users/SLaptop/Downloads/php-7.4.11/ext/intl/collator/collator_sort.c:543:26: error:
      use of undeclared identifier 'FALSE'
        collator_sort_internal( FALSE, INTERNAL_FUNCTION_PARAM_PASSTHRU );
                                ^
2 errors generated.
make: *** [collator/collator_sort.lo] Error 1


Any help much appreciated!
Thanks!
stevenc
 
Posts: 10
Joined: 29. October 2018 00:39
XAMPP version: 7.4.11
Operating System: Mac OS X 10.15.7

Re: mac xampp php 7 intl extension

Postby stevenc » 27. October 2020 01:11

PHP-Int has separated out ICU utilities, making the extension difficult to add to XAMPP’s installed version of PHP.

I was able to do it this time by using Macports, in Mac's CLI:

sudo port install php74-intl

then, go to

/opt/local/lib/php/extensions/no-debug-non-zts-20090626/intl.so [php folder may have a number, like php74]

copy the intl.so file into

/Applications/xampp/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/ [date will vary]

Change the PHP.ini file to include the intl.so file.

And it worked ... this time, anyway!
stevenc
 
Posts: 10
Joined: 29. October 2018 00:39
XAMPP version: 7.4.11
Operating System: Mac OS X 10.15.7


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 23 guests