一篇很好的配置文档,转载到这里防止自己以后找不到,原文地址centos6.5 系统-搭建lamp(php7)环境--(yum在线安装)
- 查看当前服务器的版本
#方法1
cat /etc/redhat-release
#方法2
rpm -q centos-release</pre>
- 安装apache
#一键安装apache
yum install httpd
#启动apche
/etc/init.d/httpd start #方法1
service httpd start #方法2
#设置apache开机自动启动
chkconfig --levels 235 httpd on </pre>
- 安装php7.1
#更新yum源(默认yum源中无php7)
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
#安装php及常用的拓展模块
yum -y install php71w php71w-mysql php71w-mbstring php71w-mcrypt php71w-gd php71w-imap php71w-ldap php71w-odbc php71w-pear php71w-xml php71w-xmlrpc php71w-pdo
#查看php安装了那些拓展模块
php -m
#安装其他你需要的拓展模块
yum -y install php71w-xxx
- 安装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
网友评论