php7安装intl,失败

问答中心分类: PHPphp7安装intl,失败
匿名用户 asked 8 年 ago
请管理员看看,谢谢。
按照http://oneinstack.com/question/after-the-installation-is-complete-found-no-intl-extensions-how-to-solve/
所说的步骤  icu版本 换位56,编译出错。报错如下:

error: ext/standard/php_smart_str.h: No such file or directory

4 Answers
oneinstack answered 8 年 ago
/root/oneinstack/src/php-7.0.1/ext/intl
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install

修改/usr/local/php/etc/php.ini配置:加入extension=intl.so

匿名用户 answered 8 年 ago
好的。 我先试一下,有结果了 回来补上。

匿名用户 answered 8 年 ago
搞定了。 

安装icu
cd /usr/local/src/
wget http://download.icu-project.org/files/icu4c/56.1/icu4c-56_1-src.tgz
tar -xzf icu4c-56_1-src.tgz
cd icu/source
./configure -prefix=/usr/local/icu
make && make install
安装intl
cd /usr/local/src/lnmp/src/
tar -xzf php-7.0.1.tar.gz
cd php-7.0.1/ext/intl
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
echo 'extension = intl.so' >> /usr/local/php/etc/php.ini
service php-fpm restart
 

匿名用户 answered 8 年 ago
呃。。。上面有句话错了
php 编译intl的时候 要指定icu路径

./configure –with-php-config=/usr/local/php/bin/php-config --with-icu-dir=/usr/local/icu