php编译安装扩展

以php7.2.6为例

1、下载php7.2.6版本,
php-7.2.6.tar.gz

tar xzvf php-7.2.6.tar.gz  解压
  • 确认phpize路径
[root@localhost openssl]# whereis phpize
phpize: /usr/bin/phpize

  • 确认下php-config的路径
[root@localhost booksi]# find / -name php-config
/usr/local/php/bin/php-config

2.进入目录

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

php加载模块有两种方式,一种是通过php.ini 加载模块,另一种是通过编译时的参数加载模块。

你可能感兴趣的:(php编译安装扩展)