Centos 5.7下安装PHP+Nginx+FastCGI

1.centos版本

lsb_release -a

LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 5.7 (Final)
Release: 5.7
Codename: Final

2.设置EPEL,EPEL是一个红帽子下一个提供大量第三方包的Repository,不然下文的spawn-fcgi yum无法找到资源

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


3.Install ngnix

yum install nginx
#为nginx创建用户组
groupadd nginx
useradd -d /home/nginx -g nginx nginx


4.Configure PHP As FastCGI

# yum install php-pear-Net-Socket php-pear php-common php-gd php-devel php php-mbstring php-pear-Mail php-cli php-imap php-snmp php-pdo php-xml php-pear-Auth-SASL php-ldap php-pear-Net-SMTP php-mysql

# yum install spawn-fcgi

# wget http://bash.cyberciti.biz/dl/419.sh.zip
# unzip 419.sh.zip
# mv 419.sh /etc/init.d/php_cgi
# chmod +x /etc/init.d/php_cgi

# /etc/init.d/php_cgi start
# netstat -tulpn | grep :9000


5.安装json模块

php安装json模块 RedHat/Centos
yum install php-devel
yum install php-pear
yum install gcc
pecl自动编译安装:
pear install pecl/json
cd /etc/php.d
echo "extension=json.so" > json.ini
service httpd restart
查看是否安装成功
php in.php |grep json
php -m|grep json
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值