- pecl扩展(以下的pecl源码改名后放到php源码的ext目录下)
i.memcache-3.0.4->memcache
ii.APC-3.1.4->apc
iii.imagick-3.0.0->imagick
(已经把memcache,apc模块源码放到ext子目录中,名称如上)
#cd /your/phpsrcdir #rm configure #./buildconf --force #./configure --help(选项出现了!)
- 预装软件:
ImageMagick
#make WITHOUT_X11=yes install clean
(时间较长,干点别的去)
libevent(php-fpm需要,ports)
#make install clean
curl(ports)
#make install clean
libmcrypt(ports)
#make install clean
- 手动编译php,每个参数都要知道具体是干嘛的,5.3.3之后,有了php-fpm,--enable-fastcgi就不再需要了,mysqli以及pdo-mysql都用mysqlnd
#'./configure' '--prefix=/usr/local/php5_admin' '--with-layout=GNU' '--with-config-file-scan-dir=/usr/local/php5_admin/etc/php' '--disable-all' '--enable-dom' '--enable-filter' '--enable-hash' '--enable-json' '--with-mcrypt' '--with-curl' '--with-pcre-regex' '--enable-mbstring' '--enable-ctype' '--enable-session' '--enable-libxml' '--enable-simplexml' '--enable-pdo' '--with-pdo-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--enable-sysvsem' '--enable-sysvshm' '--enable-apc' '--enable-memcache' '--with-imagick=/usr/local' '--enable-fpm' '--with-gd' '--enable-gd-native-ttf' '--with-mysql'
- 配置
#cp /usr/local/php5_admin/etc/php-fpm.conf.default /usr/local/php5_admin/etc/php-fpm.conf
几个需要配置的参数
pm.max_children
pm.start_servers
pm.min_spare_servers
pm.max_spare_servers
启动脚本
/usr/local/etc/rc.d/phpfpm
#!/bin/sh # PROVIDE: phpfpm # REQUIRE: DAEMON # # Add the following lines to /etc/rc.conf to run phpfpm: # # phpfpm_enable (bool): Set it to "YES" to enable {phpfpm}. # Default is "NO". # # Last-Modified: 2010-09-14 23:30:20 name="phpfpm" . /etc/rc.subr rcvar=`set_rcvar` load_rc_config ${name} eval ${name}_enable=/${${name}_enable:-"NO"} eval server=/${${name}_server:-"/usr/local/php5_admin/sbin/php-fpm"} command=${server} extra_commands="reload" sig_reload="USR2" pidfile="/usr/local/php5_admin/var/run/php-fpm.pid" #command_args="" run_rc_command "$1"
在/etc/rc.conf中加入phpfpm_enable="YES"
#/usr/local/etc/rc.d/phpfpm start
启动ok
注:
1 ./buildconf --force 时,可能会报autoconf version 6.68错误
解决把它卸载,
出现 “configure: error: Cannot find MySQL header files under yes.”错误 解决:
http://blog.sina.com.cn/s/blog_56a70c0401000are.html
==============================================
点缀娱乐 点缀娱乐 点缀娱乐 点缀娱乐 点缀娱乐 点缀娱乐 点缀娱乐 点缀娱乐
==============================================