安装php5.4 -with fast-cgi

cd ~
wget http://jp1.php.net/distributions/php-5.4.12.tar.bz2
tar -jxvf php-5.4.12.tar.bz2
cd php-5.4.12
./configure --prefix=/data1/video_upload/php --enable-fpm
make && make install

cp -R ./sapi/fpm/php-fpm.conf /data1/video_upload/php/etc/php-fpm.conf
sed -i 's/user = nobody/user = www/g' /data1/video_upload/php/etc/php-fpm.conf
sed -i 's/group = nobody/group = www/g' /data1/video_upload/php/etc/php-fpm.conf
sed -i 's/pm.max_children = 5/pm.max_children = 20/g' /data1/video_upload/php/etc/php-fpm.conf
sed -i 's/pm.start_servers = 2/pm.start_servers = 5/g' /data1/video_upload/php/etc/php-fpm.conf
sed -i 's/pm.min_spare_servers = 1/pm.min_spare_servers = 5/g' /data1/video_upload/php/etc/php-fpm.conf
sed -i 's/pm.max_spare_servers = 3/pm.max_spare_servers = 20/g' /data1/video_upload/php/etc/php-fpm.conf
sed -i 's/listen = 127.0.0.1:9000/listen = 127.0.0.1:9100/g' /data1/video_upload/php/etc/php-fpm.conf

cp -R ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm_upload

chmod 755 /etc/init.d/php-fpm_upload


启动  sbin/php-fpm


nginx的配置

   location ~ \.php$ {
            root           html/wenjian/www;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /data1/video_upload/nginx/html/wenjian/www/$fastcgi_script_name;
            include        fastcgi_params;
        }


你可能感兴趣的:(php)