centos初始化安装

1.yum 安装 nginx

rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

yum info nginx

yum install niginx

service nginx start

 

2.yum 安装 php5.5 php-fpm

## Remi Dependency on CentOS 6 ##
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

yum --enablerepo=remi,remi-php55 install nginx php-fpm php-common
yum --enablerepo=remi,remi-php55 install php-pecl-apcu php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml

 

3.开机自动启动nginx,php-fpm

chkconfig --add nginx
chkconfig --levels 235 nginx on

chkconfig --add php-fpm
chkconfig --levels 235 php-fpm on

 

参考:http://www.if-not-true-then-false.com/2011/install-nginx-php-fpm-on-fedora-centos-red-hat-rhel/

 

centos上的卸载命令(以php为例)

rpm -qa|grep php

提示如下

#php-pdo-5.1.6-27.el5_5.3
#php-mysql-5.1.6-27.el5_5.3
#php-xml-5.1.6-27.el5_5.3
#php-cli-5.1.6-27.el5_5.3
#php-common-5.1.6-27.el5_5.3
#php-gd-5.1.6-27.el5_5.3

注意卸载要先卸载没有依赖的

pdo是mysql的依赖项;common是gd的依赖项;
例如:# rpm -e php-pdo-5.1.6-27.el5_5.3
error: Failed dependencies:
        php-pdo is needed by (installed) php-mysql-5.1.6-27.el5_5.3.i386

所以正确的卸载顺序是:

rpm -e php-mysql-5.1.6-27.el5_5.3 
rpm -e php-pdo-5.1.6-27.el5_5.3 
rpm -e php-xml-5.1.6-27.el5_5.3 
rpm -e php-cli-5.1.6-27.el5_5.3 
rpm -e php-gd-5.1.6-27.el5_5.3 
rpm -e php-common-5.1.6-27.el5_5.3 

再用# php -v

查看版本信息已经没有提示

 

转载于:https://www.cnblogs.com/enone/p/3875712.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值