LAMP环境搭建
作者:互联网
# 安装http环境 yum -y install httpd httpd-manual mod_ssl mod_perl yum -y install httpd httpd-devel systemctl start httpd.service 输入公网地址有Apache服务说明成功 # 安装mysql环境 rpm -e mariadb-libs --nodeps (卸载mariadb,出现not installed没关系) yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-common-5.7.36-1.el7.x86_64.rpm yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-libs-5.7.36-1.el7.x86_64.rpm yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-libs-compat-5.7.36-1.el7.x86_64.rpm yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-client-5.7.36-1.el7.x86_64.rpm yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-server-5.7.36-1.el7.x86_64.rpm # 更换密码 mysql -V systemctl start mysqld.service grep "password" /var/log/mysqld.log mysql -uroot -p (手动输入上面出现的密码) set global validate_password_policy=0; ALTER USER 'root'@'localhost' IDENTIFIED BY '000000pP-'; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '000000pP-'; exit # 安装php环境 yum -y install php gd php-gd gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc 若提示:No match for argument: php-mysql,php-imap rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm yum search php-mysql php-mysql改为php-mysqlnd再次安装:yum install php-mysqlnd yum install php-imap # 测试php页面 echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php systemctl restart httpd http://<ECS公网IP>/phpinfo.php, 访问到了则安装ok # 安装phpadmin mkdir -p /var/www/html/phpmyadmin wget --no-check-certificate https://files.phpmyadmin.net/phpMyAdmin/4.0.10.20/phpMyAdmin-4.0.10.20-all-languages.zip yum install -y unzip unzip phpMyAdmin-4.0.10.20-all-languages.zip mv phpMyAdmin-4.0.10.20-all-languages/* /var/www/html/phpmyadmin 在本地浏览器的址栏中,输入http://实例公网 IP/phpmyadmin。 页面正常则安装ok,输入msyql的用户名密码进去
标签:5.7,环境,LAMP,yum,install,mysql,php,rpm,搭建 来源: https://www.cnblogs.com/teark/p/16198224.html