Question

When i installed the framework Yii2 and i verified to launch requirements.php for check if PHP extensions have been loaded.

Requirements

  1. I installed icu4c using brew like :

    brew install icu4c

  2. I installed intl using PECL like :

    /Applications/MAMP/bin/php/php5.5.3/bin/pecl install intl

    Dir icu4c : /usr/local/Cellar/icu4c/52.1/

  3. In PHPInfo, i have :

PHPInfo

But in Yii2, i launched requirements.php and the extension intl is not always work.

Info : When i execute /Applications/MAMP/bin/php/php5.5.3/bin/php -m :

[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
imap
json
ldap
libxml
mbstring
mcrypt
mysql
mysqli
openssl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
Reflection
session
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
xsl
yaz
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

And i see not where intl... Is this normal ? I wonder if the problem is rather to MAMP or PECL ?

Thanks.

EDIT :

Yii Framework fixed : https://github.com/yiisoft/yii2/issues/1230

Was it helpful?

Solution

It might be that PHP on apache uses a different php.ini files than PHP on CLI.

Find out for CLI by running

$ php --ini

The php.ini for apache can be seen in phpinfo().

If they are different, you need to add the extension loading directive to the CLI one, too.

Also make sure to restart apache after modifying the php.ini for mod_php.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top