Linux下PHP已经编译,如何新增so扩展。

PHP下载地址:http://cl1.php.net/distributions/php-5.5.14.tar.gz

用到的一个sh:/usr/local/php/bin/phpize

原理:用phpize在压缩包里面找到对应的对应的扩展文件夹,在里面执行phpize,具体步骤:

PHP安装路径:/usr/local/php

PHP源码路径:/root/php-5.5.14

扩展假设zlib:/root/php-5.5.14/ext/bz2

执行代码:

ln -s /usr/local/php/bin/phpize /usr/bin/phpize

cd /root/php-5.5.14/ext/bz2

phpize

//这里提示报错,安装bzip2,bzip2-devel configure: error: Please reinstall the BZip2 distribution

//yum install -y bzip2 bzip2-devel

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

make

make test

make install

vim /etc/php.ini ##加入extension=bz2.so

Comments are closed.

Post Navigation