centos6.5 系统-搭建lamp(php7)环境--(yum在线安装)

本文详细介绍了在 CentOS 6.5 系统上安装 LAMP (Linux, Apache, MySQL, PHP) 的步骤。包括如何检查服务器版本、安装 Apache 服务器、配置 PHP 7 以及安装 MySQL 5.5 数据库。

1、查看当前服务器的版本

#方法1
cat /etc/redhat-release

#方法2
rpm -q centos-release

 

2、安装apache

#一键安装apache
yum install httpd

#启动apche
/etc/init.d/httpd start                     #方法1 
service httpd start                         #方法2

#设置apache开机自动启动
chkconfig --levels 235 httpd on 

 

3、安装php7

#更新yum源(默认yum源中无php7)
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm  

#安装php及常用的拓展模块
yum -y install php70w php70w-mysql php70w-mbstring php70w-mcrypt php70w-gd php70w-imap php70w-ldap php70w-odbc php70w-pear php70w-xml php70w-xmlrpc php70w-pdo

#查看php安装了那些拓展模块
php -m

#安装其他你需要的拓展模块
yum -y install php70w-xxx

 

4、安装mysql5.5

#查询是否安装了mysql,默认是安装了mysql-libs的5.1版本的。需卸载
rpm -qa|grep mysql
rpm -e mysql-libs --nodeps       #不检测依赖性

#增加两个新的repo源
rpm -Uvh http://mirror.steadfast.net/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

#检测源是否安装成功
yum --enablerepo=remi,remi-test list mysql mysql-server

#安装mysql5.5
yum -y --enablerepo=remi,remi-test install mysql mysql-server

#启动mysql
/etc/init.d/mysqld start

#将mysql设置为开机自动启动
chkconfig --levels 345 mysqld on

#设置mysql的root密码
/usr/bin/mysql_secure_installation

注:次教程只在centos6.5系统上测试过,其他版本有待检测!

转载于:https://www.cnblogs.com/zsl123/p/6812735.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值