提示 | |
---|---|
PHP 5.3.3 后续版本已经集成php-fpm 不需要打补丁再安装. |
http://php-fpm.org/downloads/
[root@freebsd1:~] cd /usr/src/ [root@freebsd1:/usr/src] wget http://php-fpm.org/downloads/php-5.2.14-fpm-0.5.14.diff.gz wget http://www.php.net/get/php-5.2.14.tar.gz/from/cn.php.net/mirror [root@freebsd1:/usr/src] tar zxf php-5.2.14.tar.gz gzip -cd php-5.2.14-fpm-0.5.14.diff.gz | patch -d php-5.2.14 -p1 [root@freebsd1:/usr/src] cd php-5.2.14 ./configure --prefix=/usr/local/php-5.2.14 \ --with-config-file-path=/usr/local/php-5.2.14/etc \ --enable-fastcgi --enable-fpm \ --with-curl \ --with-gd \ --with-jpeg-dir=/usr/lib64 \ --with-iconv \ --with-mcrypt \ --with-zlib \ --with-pear \ --with-xmlrpc \ --with-openssl \ --with-mysql \ --with-mysqli \ --with-pdo-mysql \ --enable-zip \ --enable-sockets \ --enable-soap \ --enable-mbstring \ --enable-magic-quotes \ --enable-inline-optimization \ --enable-xml \ --enable-ftp make && make install
配置php.ini与php-fpm.conf
cp php.ini-dist /usr/local/php-5.2.14/etc/php.ini /usr/local/php-5.2.14/etc/php.ini include_path = ".:/www/includes:/usr/local/php-5.2.14/lib/php" vim /usr/local/php-5.2.14/etc/php-fpm.conf <value name="owner">www</value> <value name="group">www</value> <value name="user">www</value> <value name="group">www</value> /usr/local/php-5.2.14/sbin/php-fpm start
安装zlib =========================================================== ./configure make test make install 安装gd =========================================================== cd /usr/ports/graphic/gd make install 安装libpng =========================================================== cd /usr/ports/graphics/png make install =========================================================== 安装jpeg =========================================================== cd /usr/ports/graphics/jpeg make install =========================================================== 安装freetype =========================================================== cd /usr/ports/print/freetype make install
./configure --prefix=/usr/local/php-5.3.5 \ --with-config-file-path=/usr/local/php-5.3.5/etc \ --with-config-file-scan-dir=/usr/local/php-5.3.5/etc/conf.d \ --enable-fpm \ --with-fpm-user=www \ --with-fpm-group=www \ --with-pear \ --with-curl \ --with-gd \ --with-jpeg-dir \ --with-png-dir \ --with-freetype-dir \ --with-iconv \ --with-mcrypt \ --with-mhash \ --with-zlib \ --with-xmlrpc \ --with-xsl \ --with-openssl \ --with-mysql \ --with-mysqli \ --with-pdo-mysql \ --disable-debug \ --enable-zip \ --enable-sockets \ --enable-soap \ --enable-mbstring \ --enable-magic-quotes \ --enable-inline-optimization \ --enable-memory-limit --enable-xml \ --enable-ftp \ --enable-exif \ --enable-wddx \ --enable-bcmath \ --enable-calendar \ --enable-sqlite-utf8 \ --enable-shmop \ --enable-dba \ --enable-sysvsem \ --enable-sysvshm \ --enable-sysvmsg make make install
php.ini
include_path=.:/usr/local/php-5.3.5/lib/php
php-fpm.conf
cp /usr/local/php-5.3.5/etc/php-fpm.conf.default /usr/local/php-5.3.5/etc/php-fpm.conf cp /usr/src/php-5.3.5/sapi/fpm/init.d.php-fpm /usr/local/etc/rc.d/php-fpm chmod +x /usr/local/etc/rc.d/php-fpm vim /usr/local/php-5.3.5/etc/php-fpm.conf pid = run/php-fpm.pid user = www group = www pm.start_servers = 20 pm.min_spare_servers = 5 pm.max_spare_servers = 35
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。