沙滩星空的博客沙滩星空的博客

PHP扩展模块安装

1.进入PHP扩展源码目录:
例:

cd php-5.5.8/ext/intl

2.运行phpzie命令,生成configure文件

phpize

/usr/local/bin/phpize

3.编译前配置:

./configure

./configure --with-php-config=/usr/local/php/bin/php-config

4.运行make命令

make

5.测试编译安装

make test

6.正式编译安装

make install

7.上一步编译安装完。生成.so的php扩展文件。记下来。并加入到php.ini

vim /usr/local/php/etc/php.ini
...
extension=ssh2.so
...

8.重启php-fpm

/usr/local/php/sbin/php-fpm

若configure 这步报错:

configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.

说明缺少icu依赖.请安装后再进行扩展模块的编译安装。
CentOS / RedHat:

yum install libicu-devel

Ubuntu/Debian:

sudo apt-get install libicu-dev

Mac:

brew install icu4c

然后(Mac系统,其他的类似,替换icu对应目录即可):

./configure --with-icu-dir=/usr/local/opt/icu4c
make && make install

--with-icu-dir路径根据具体情况而定


wget http://download.icu-project.org/files/icu4c/52.1/icu4c-52_1-src.tgz
tar -zxf icu4c-52_1-src.tgz
cd icu/source
./configure --prefix=/usr/local/icu
make && make install


php7安装intl扩展 https://www.jianshu.com/p/0d2a78ec84de PHP编译问题整理
https://blog.csdn.net/qq_40058224/article/details/80973603
configure: error: Unable to detect ICU prefix问题解决 http://www.it610.com/article/2159546.htm
未经允许不得转载:沙滩星空的博客 » PHP扩展模块安装

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址