为什么80%的码农都做不了架构师?>>>
一.下载安装包
[root@test ~]# wget http://cn2.php.net/distributions/php-5.5.4.tar.bz2
二.配置安装环境
[root@test ~]# yum -y install gcc automake autoconf libtool make
[root@test ~]# yum -y install gcc gcc-c++ glibc
[root@test ~]# yum -y install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel
[root@test ~]# tar jxfv php-5.5.4.tar.bz2
[root@test ~]# cd php-5.5.4
[root@test php-5.5.4]# ./configure --prefix=/usr/local/php --enable-fpm --enable-mbstring --disable-pdo --with-curl --disable-debug --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli --with-gd --with-jpeg-dir --with-config-file-path=/etc
[root@test php-5.5.4]# make all install
[root@test ~]# cd /usr/local/php/etc/
[root@test etc]# cp php-fpm.conf.default php-fpm.conf
user = nginx
设置用于设置php-fpm对打开文件描述符的限制
group = nginx
rlimit_files = 65536
标签allowed_clients用于设置允许访问Fastcgi进程解析器的IP地址
listen.allowed_clients = 127.0.0.1
[root@test ~]# vim /etc/nginx/nginx.conf
# pass the PHP scripts to FastCGI server listening on 127 . 0 . 0 . 1 : 9000
#
server { listen 80 ; server_name www.abc.com ; root /usr/html/abc/ ; location / { index index.html index.php ; }
location ~ \.php$ { fastcgi_pass 127 . 0 . 0 . 1 : 9000 ; fastcgi_index index.php ; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name ; include fastcgi_params ; }
}
[root@test ~]# killall nginx
[root@test ~]# /usr/sbin/nginx
[root@test ~]# /usr/local/php/sbin/php-fpm
fastcgi_cache_path /usr/ local /nginx/fastcgi_cache levels= 1 : 2 keys_zone=TEST: 10m inactive
= 5m ; fastcgi_connect_timeout 300 ; fastcgi_send_timeout 300 ; fastcgi_read_timeout 300 ; fastcgi_buffer_size 64k ; fastcgi_buffers 4 64k ; fastcgi_busy_buffers_size 128k ; fastcgi_temp_file_write_size 128k ; fastcgi_cache TEST ; fastcgi_cache_valid 200 302 1h ; fastcgi_cache_valid 301 1d ; fastcgi_cache_valid any 1m ;