nginx+php5.5环境安装
1.安装依赖包
yum install -y gcc gcc-c++ make cmake* autoconf* apr apr-util libcurl* libxml2 libxml2-devel gd gd-devel bzip2-devel freetype* ncurse* bison* openssl* libjpeg*
http://www.php.net/downloads.phpwget http://cn2.php.net/distributions/php-5.5.22.tar.gz
tar -xvf php-5.5.22.tar.gzcd php-5.5.22./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/etc --with-bz2 --with-curl --enable-ftp--enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir=/usr/local--with-png-dir=/usr/local--with-freetype-dir=/usr/local--enable-gd-native-ttf --with-iconv-dir=/usr/local--enable-mbstring --enable-calendar --with-gettext --with-libxml-dir=/usr/local--with-zlib --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --enable-dom --enable-xml --enable-fpm --with-libdir=lib64makemake install
cp php.ini-production /usr/local/php5/etc/php.inicp /usr/local/php5/etc/php-fpm.conf.default /usr/local/php5/etc/php-fpm.conf
/usr/local/php5/sbin/php-fpm
# netstat -lnt | grep 9000tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN
vi /usr/local/nginx/conf/nginx.conf server { listen 80; #server_name 127.0.0.1; root /data/www/test/; charset utf-8; index index.html index.php; location /{ try_files $uri $uri/ /index.php?$args; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { expires -1s; try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; } location ~ .*\.(jpg|JPG|jpeg|JPEG|css|bmp|gif|GIF|png|PNG)$ { access_log off; } }
cd /data/www/phptest/vi /data/www/phptest/index.php<?phpphpinfo ();?>
/usr/local/php5/sbin/php-fpm
/usr/local/nginx/sbin/nginx
kill -INT `cat /usr/local/php/var/run/php-fpm.pid`
kill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`
ps aux | grep -c php-fpm
#touch /tmp/php-cgi/php-cgi.socket
# fastcgi_pass 127.0.0.1:9000;fastcgi_pass unix:/tmp/php-cgi/php-cgi.socket;
#listen = 127.0.0.1:9000listen = /tmp/php-cgi/php-cgi.socket