您的位置:首页 > 编程语言 > PHP开发

编译php源码时,怎么加上自定义的一些扩展

2013-12-08 10:43 597 查看
wget https://github.com/php/php-src/archive/PHP-5.3.17.zip unzip PHP-5.3.17.zip


Get mysqlnd_qc:
wget http://pecl.php.net/get/mysqlnd_qc-1.1.1.tgz tar -zxvf http://pecl.php.net/get/mysqlnd_qc-1.1.1.tgz mkdir -p php-src-PHP-5.3.17/ext/mysqlnd_qc
cp -R mysqlnd_qc-1.1.1/* php-src-PHP-5.3.17/ext/mysqlnd_qc


Get APC:
wget http://pecl.php.net/get/APC-3.1.13.tgz tar -xzvf APC-3.1.13.tgz
mkdir -p php-src-PHP-5.3.17/ext/apc
cp -R APC-3.1.13/* php-src-PHP-5.3.17/ext/apc/


Compile: (maybe don't need all on other systems)
sudo yum install bison
sudo yum install libxml2 libxml2-devel
sudo yum install autoconf213
sudo yum install httpd-devel
sudo yum install bzip2 lbzip2 bzip2-libs bzip2-devel

export PHP_AUTOCONF=/usr/bin/autoconf-2.13

./buildconf --force
make clean && make


(for me the linkage failed and had to add '-lpthread' to linkage)
make test
sudo make install


I used also the following 2 commands but I don't remember for what and when...
phpize
aclocal


Run the same 
./configure
 as
in phpinfo and add these options:
--with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-mysqlnd-qc --enable-mysqlnd-qc-apc --enable-mysqlnd --enable-apc --enable-static=apc
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: