linux Centos7.4安装php7或php5

一、php的安装
php5的安装
1. rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
2. rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
3. yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64
4. yum install php56w-fpm
5. systemctl start php-fpm.service
6. systemctl enable php-fpm.service

php7的安装
1. yum -y update
2. rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
3. rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
4. yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64
5. yum install php70w-fpm
6. systemctl start php-fpm.service
7. systemctl enable php-fpm.service //设置开机启动

二、Apache 安装
1. yum install httpd
2. systemctl enable httpd
3. systemctl start httpd

三、安装mysql
1. wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
2. yum localinstall mysql57-community-release-el7-8.noarch.rpm
3. yum install mysql-community-server
4. systemctl start mysqld
5. systemctl enable mysqld
6. grep 'temporary password' /var/log/mysqld.log //查看密码,localhost后面的随机字符串
这里写图片描述
7. mysql -u root -p //根据输入密码登录
8. ALTER USER 'root'@'localhost' IDENTIFIED BY '密码'; //修改初始密码
//会出现错误:ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
//引用 https://blog.csdn.net/maxsky/article/details/51171474
9. set global validate_password_policy=0;
10. set global validate_password_length=3;
//设置远程链接权限
11. GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
12. systemctl restart mysqld //重启生效
四、安装phpMyAdmin
1. yum install phpmyadmin
2. vi /etc/httpd/conf.d/phpMyAdmin.conf //修改phpMyAdmin配置文件
这里写图片描述
3. systemctl restart httpd //重启
文章来源
https://blog.csdn.net/yangchuan_csdn91/article/details/78517724
http://www.cnblogs.com/mangoVic/p/6393504.html
https://blog.csdn.net/maxsky/article/details/51171474

©️2020 CSDN 皮肤主题: 大白 设计师: CSDN官方博客 返回首页
实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值