rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
提示错误:
error: Failed dependencies:
epel-release >= 7 is needed by webtatic-release-7-3.noarch
需要先安装epel-release。
1.安装epel-release
通过命令:
yum -y install epel-release
成功安装。
2.安装PHP7
执行下面的命令升级软件仓库:
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
然后就可以直接yum安装php7.0了,可以安装的拓展如下:
yum install php70w-common php70w-fpmphp70w-opcache php70w-gd php70w-mysqlnd php70w-mbstring php70w-pecl-redisphp70w-pecl-memcached php70w-devel
yum -y install php70w php70w-mysqlphp70w-mbstring php70w-mcrypt php70w-gd php70w-imap php70w-ldap php70w-odbcphp70w-pear php70w-xml php70w-xmlrpc php70w-pdo
重启httpd
service httpd restart
查看最新的版本
php -v
现在应该是7.0了!
更多拓展:
http://blog.csdn.net/zhezhebie/article/details/73325663
三、安装MySQL
由于yum源上没有mysql-server。所以必须去官网下载,这里我们用wget命令,直接获取。
# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum install mysql-community-server
安装完成后重启mysql, service mysqld restart
初入安装 root用户没有密码:
[root@linuxidc-web linuxidc]# mysql -u root
#设置msyql密码为 123456
mysql> set password for'root'@'localhost' =password('123456');
#远程连接设置,所有以root账号连接的远程用户,设其密码为 123456
mysql> grant all privileges on *.* to root@'%'identified by '123456';
#更新权限
mysql>flush privileges;
至此 lamp环境已经搭建成功
外网连接mysql还需配置防火墙和端口需配置阿里云安全组
以下解决办法
systemctl enable firewalld # 开机启动
systemctl stop firewalld #关闭