1.检查当前安装的PHP包
yumlistinstalled|grepPHP
如果要删除,可执行
yumremovePHP.x86_64PHP-cli.x86_64PHP-common.x86_64PHP-gd.x86_64PHP-ldap.x86_64PHP-mbstring.x86_64PHP-mcrypt.x86_64PHP-MysqL.x86_64PHP-pdo.x86_64
2.rpm包
CentOs 5.x
rpm-Uvhhttp://mirror.webtatic.com/yum/el5/latest.rpm
CentOs6.x
rpm-Uvhhttp://mirror.webtatic.com/yum/el6/latest.rpm
CentOs7.X
rpm-Uvhhttps://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm-Uvhhttps://mirror.webtatic.com/yum/el7/webtatic-release.rpm
如果想删除上面安装的包,重新安装
rpm -qa | grep webstatic
rpm -e 上面搜索到的包即可
3.查看可安装的PHP版本
yum list PHP*
4.安装
这里我选择了PHP5.6来安装
yum -y install PHP56w.x86_64
============================================
安装apache2.4
执行
cd /etc/yum.repos.d
wget http://repos.fedorapeople.org/repos/jkaluza/httpd24/epel-httpd24.repo
wget http://www.hop5.in/yum/el6/hop5.repo
查看可安装httpd
yum.repos.d]# yum list httpd*
安装
yum install httpd24-httpd httpd24-httpd-devel httpd24-mod_ssl hhvm
------------------
如果发生冲突问题,先把之前已安装的版本先卸载
查看已安装
yum list installed httpd*
卸载
yum remove httpd
----------------------------
=========================================
安装MysqL5.7.15
官方下载
http://dev.mysql.com/downloads/mysql/
cd /
wget http://cdn.MysqL.com//Downloads/MysqL-5.7/MysqL-community-common-5.7.15-1.el6.x86_64.rpm
wget http://cdn.MysqL.com//Downloads/MysqL-5.7/MysqL-community-libs-5.7.15-1.el6.x86_64.rpm
wget http://cdn.MysqL.com//Downloads/MysqL-5.7/MysqL-community-client-5.7.15-1.el6.x86_64.rpm
wget http://cdn.MysqL.com//Downloads/MysqL-5.7/MysqL-community-server-5.7.15-1.el6.x86_64.rpm
下载以上文件到到 /目录
先安装依赖(MysqL5.7需要)
yum -y install numactl
yum -y install perl
依次执行安装
rpm -ivh MysqL-community-common-5.7.15-1.el6.x86_64.rpm
rpm -ivh MysqL-community-libs-5.7.15-1.el6.x86_64.rpm
rpm -ivh MysqL-community-client-5.7.15-1.el6.x86_64.rpm
rpm -ivh MysqL-community-server-5.7.15-1.el6.x86_64.rpm
启动
service MysqLd start
开机自动启动
chkconfig MysqLd on
获得MysqL初始密码
grep'temporarypassword'/var/log/MysqLd.log
这里的 >gjpjgkb:0cX 就是root的默认密码
MysqL -uroot -p'密码'
即 MysqL -uroot -p'>gjpjgkb:0cX'
MysqL5.7的安全机制加强,要求立即修改密码,否则无法继续操作
修改新密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码';
注意密码要足够复杂(8位,大写字母,小写字母,数字,特殊符号),否则修改失败
允许远程登录
Grant all privileges on *.* to 'root'@'%' identified by 'HAOabc2016!' with grant option;
flush privileges;
MysqL的默认安装位置
/etc/my.cnf
#配置文件
/usr/bin
#相关命令目录
/etc/init.d/MysqL
#启动脚本