Can’t install php extension intl for php 7.2, Mac OS High Sierra


(Techno Swift) #1

this is the message i am getting

icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).

If you need to have icu4c first in your PATH run:
echo ‘export PATH="/usr/local/opt/icu4c/bin:$PATH"’ >> ~/.bash_profile
echo ‘export PATH="/usr/local/opt/icu4c/sbin:$PATH"’ >> ~/.bash_profile

For compilers to find icu4c you may need to set:
export LDFLAGS="-L/usr/local/opt/icu4c/lib"
export CPPFLAGS="-I/usr/local/opt/icu4c/include"

For pkg-config to find icu4c you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"

==> Summary
:beer: /usr/local/Cellar/icu4c/63.1: 254 files, 68.4MB
Nittns-MacBook-Air:~ baanallc$ export PATH="/usr/local/opt/icu4c/bin:PATH" Nittns-MacBook-Air:~ baanallc ~/.bash_profile
-bash: /Users/baanallc/.bash_profile: Permission denied


(Sean Molenaar) #2

Run php -m it’s already there.


(Techno Swift) #3

intl is not there on macOS php 7.2 , don’t know why, here is the list i got

Nittns-MacBook-Air:~ baanallc$ php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
exif
fileinfo
filter
ftp
gd
hash
iconv
json
ldap
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
snmp
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib
[Zend Modules]


(Sean Molenaar) #4

What happens when you run which php and php -v?


(Techno Swift) #5

Nittns-MacBook-Air:~ baanallc$ which php
/Applications/XAMPP/xamppfiles/bin/php

Nittns-MacBook-Air:~ baanallc$ php -v
Warning: PHP Startup: Unable to load dynamic library ‘intl.so’ (tried: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20170718/intl.so (dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20170718/intl.so, 9): image not found), /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20170718/intl.so.so (dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20170718/intl.so.so, 9): image not found)) in Unknown on line 0

PHP 7.2.12 (cli) (built: Nov 15 2018 01:06:07) ( NTS )

Copyright © 1997-2018 The PHP Group

Zend Engine v3.2.0, Copyright © 1998-2018 Zend Technologies


(Sean Molenaar) #6

Yeah, that’s not the homebrew php. It’s the one from XAMPP. I can’t help you with this.


(Techno Swift) #7

thanks what the best way to go from here.
thanks


(Sean Molenaar) #8

If you want to continue using xampp you should check here: https://www.apachefriends.org/index.html

If you want to use homebrew you’ll have to put /usr/local/bin in your $PATH before /Applications/XAMPP/xamppfiles/bin


(Techno Swift) #9

ok i have changed to macOS home php, please advise on how to get the intl extension

$ which php
/usr/local/bin/php

$ php -v
PHP 7.2.12 (cli) (built: Nov 29 2018 01:59:12) ( NTS )
Copyright © 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright © 1998-2018 Zend Technologies
with Zend OPcache v7.2.12, Copyright © 1999-2018, by Zend Technologies


(Techno Swift) #10

hi now i am getting this error, when trying to provide directory /usr/local/cellar/icu4c/63.1

1 error generated.
make: *** [php_intl.lo] Error 1
ERROR: `make’ failed


(Sean Molenaar) #11

for homebrew it’s already there.


(Techno Swift) #12

where can i find it,

need help
thanks


(Sean Molenaar) #13

If you use the homebrew php you can do php -m and it’ll be there.