在Debian 6 VPS下编译php-fpm

Posted by yar999 in Linux技术 on 2011/02/21 with No Comments

编译环境准备
首先查看debian的apt软件库的配置,确保/etc/apt/sources.list这个文件里面至少有:


deb http://ftp.us.debian.org/debian squeeze main
deb http://security.debian.org/ squeeze/updates main

然后同步一下:

apt-get update

安装编译所需要的工具:

apt-get install build-essential vim

安装编译所需要的库:

apt-get -y install libxml2-dev libmcrypt-dev libssl-dev libldap2-dev libmhash-dev libmysqlclient15-dev libcurl4-openssl-dev libpng-dev libjpeg-dev libsasl2-dev libfreetype6-dev

下载并编译php 5.2.17


wget http://www.php.net/get/php-5.2.17.tar.gz/from/this/mirror
wget http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz
mv mirror php-5.2.17.tar.gz
tar zxvf php-5.2.17.tar.gz
gzip -cd php-5.2.17-fpm-0.5.14.diff.gz | patch -d php-5.2.17 -p1
cd php-5.2.17
./configure --prefix=/opt/php --with-iconv --with-zlib --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --without-pear --with-mysql --with-mysqli --enable-sqlite-utf8 --with-pdo-mysql --enable-ftp --with-jpeg-dir --with-freetype-dir --with-png-dir
cp php.ini-dist /opt/php/lib/php.ini
ln -s /opt/php/sbin/php-fpm /etc/init.d/php-fpm
update-rc.d -f php-fpm defaults

安装php加速器eAccelerator:

cd ..
wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.tar.bz2
tar jxvf eaccelerator-0.9.6.1.tar.bz2
cd eaccelerator-0.9.6.1
/opt/php/bin/phpize
./configure --enable-eaccelerator --with-php-config=/opt/php/bin/php-config
make install

echo ‘
[eaccelerator]
zend_extension=”/opt/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so”
eaccelerator.shm_size=”16″
eaccelerator.cache_dir=”/opt/php/eaccelerator_cache”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=”"
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”3600″
eaccelerator.shm_prune_period=”3600″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″
‘ >> /opt/php/lib/php.ini

Back to Top

2007-2017 © 北京瑞豪开源科技有限公司 京ICP备13004995号-2