一、安装
php的代码会用到好多库,运行configure查看您的机器上缺少哪些库,用yum指令安装上就可以编译过了。
yum install -y gcc gcc-c++ make zlib zlib-devel pcre pcre-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
yum install libxml2-devel -y
yum install openssl openssl-devel -y
yum install curl-devel -y
yum install libjpeg-devel -y
yum install libpng-devel -y
yum install freetype-devel -yyum install openldap -y
yum install openldap-devel -y
cp -frp /usr/lib64/libldap* /usr/lib/
wget http://hk1.php.net/get/php-5.5.11.tar.bz2/from/this/mirror
'./configure' '--prefix=/usr/local/php5' '--with-mysql=/usr/share/mysql/' '--with-openssl' '--enable-fpm' '--with-mysqli=/usr/bin/mysql_config' '--with-iconv-dir' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir' '--enable-xml' '--disable-rpath' '--enable-safe-mode' '--enable-bcmath' '--enable-shmop' '--enable-sysvsem' '--enable-inline-optimization' '--with-curl' '--with-curlwrappers' '--enable-mbregex' '--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'
make ; make install;
二、配置
修改配置文件(/usr/local/php5/etc/php-fpm.conf)
[global]
pid = run/php-fpm.pid
[www]
user = nobody
group = nobody
listen = 127.0.0.1:9000
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
三、扩展
./pecl install mongo