PHP装扩展

官网下载源码包http://pecl.php.net/

如:http://pecl.php.net/get/mongodb-1.5.2.tgz

编译 - 编译

# 如果装有多个php版本,此处需要些全路径
phpize
# 如果装有多个php版本,此处需要--with-php-config=/usr/local/php7/bin/php-config,带上准确的配置文件
./configure
make
make install

编译之后,.so文件放在php -i | grep extension_dir

增加配置文件:

php -i | grep 'Scan this dir for additional'

内容:
extension=xsl.so

卸载扩展

删除老的.so文件,路径一般在/usr/lib64/php/modules(php -i | grep extension_dir)
删除配置文件,路径在(php -i | grep 'Scan this dir for additional')

原文地址:https://www.cnblogs.com/CSunShine/p/11728305.html