php7安装intl扩展的方法:1、下载icu源码包;2、解压icu及编译安装;3、下载并解压php包;4、进入php解压包目录下,编译安装;5、配置文件及启动文件即可。
本文操作环境:Windows7系统、php7.0.8版、DELL G3电脑
环境- php 版本:php7.0.8
- IP:192.168.1.99
1.1)下载icu源码包
wget http://download.icu-project.org/files/icu4c/52.1/icu4c-52_1-src.tgz
1.2)解压icu及编译安装
tar -zxf icu4c-52_1-src.tgz mkdir /usr/local/icu cd icu/source ./configure --prefix=/usr/local/icu make && make install二.php编译安装
2.1)yum 依赖包
yum -y install gcc-c++ gd libxml2-devel libjpeg-devel libpng-devel net-snmp-devel curl-devel libxslt-devel pcre-devel libjpeg libpng libxml2 libcurl4-openssl-dev libcurl-devel libcurl libmysqlclient freetype-config freetype freetype-devel unixODBC libxslt make
2.2)下载并解压php包
http://php.net/downloads.php 包下载地址
tar -zxf php-7.0.8.tar.gz
2.3)进入php解压包目录下,编译安装
cd php-7.0.8
./configure --prefix=/usr/local/php708 --with-curl --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysql --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-freetype-dir --with-jpeg-dir --with-xmlrpc --with-xsl --with-zip --with-zlib --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip --enable-intl --with-icu-dir=/usr/local/icu
make && make install
2.4)配置文件及启动文件
cp php.ini-development /usr/local/php708/lib/php.ini cp /usr/local/php708/etc/php-fpm.conf.default /usr/local/php708/etc/php-fpm.conf cp /usr/local/php708/etc/php-fpm.d/www.conf.default /usr/local/php708/etc/php-fpm.d/www.conf cp -R ./sapi/fpm/php-fpm /etc/init.d/php-fpm /etc/init.d/php-fpm
推荐学习:《PHP视频教程》