RHEL5 + Ngnix + PHP5 + Mysql Install

ref:http://blog.mixu.net/2011/01/04/nginx-php-fpm-and-node-js-install-on-centos-5-5

http://www.systmbx.com/nginx/how-to-install-nginx-with-php-5-3-and-php-fpm-support-on-centos-6

Add repositories for nginx and PHP-fpm

Just add the EPEL and Remi repos:

rpm-Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm
-Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

Install nginx and PHP-fpm

Remi has the php-fpm package (php 5.3.4); EPEL has nginx:

yum--enablerepo=remiinstall php-fpm nginx


Some other common packages:

yum --enablerepo=remi install mysql mysql-server php-mysql php-common php-gd php-mbstring php-mcrypt php-xml php-gd php-bcmath

yum --enablerepo=remi install php-channel-phpunit php-pear-PhpDocumentor php-phpunit-PHPUnit


Configure php

/etc/php5/cgi/php.ini,
[...]
cgi.fix_pathinfo = 1

Configure nginx

In /etc/nginx/nginx.conf:

location ~ \.php$ {
	root           html;
	fastcgi_pass   127.0.0.1:9000;
	fastcgi_index  index.php;
	fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
}

Start nginx and php5-fpm:

# chkconfig nginx on
# /etc/init.d/nginx start
# chkconfig php-fpm on
# /etc/init.d/php-fpm start

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值