CentOS 7系统上 搭建LAMP环境
2022-12-12
1、打补丁:
yum update -y2、安装APACHE:
yum install httpd -y3、设置开机启动:
systemctl enable httpd.service4、安装MariaDB
yum install mariadb mariadb-server -y5、开机启动:
systemctl enable mariadb.service
cp /usr/share/mysql/my-huge.cnf /etc/my.cnf
6、为root账户设置密码:
mysql_secure_installation回车,根据提示输入Y
输入2次密码,回车
根据提示一路输入Y
最后出现:Thanks for using MySQL!
MySql密码设置完成,重新启动 MySQL:
systemctl restart mariadb.service#重启MariaDB
7、安装PHP组件,使PHP支持 MariaDB
yum install php php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash php-json mod_ssl -y
8、如果是centos8以止,php-mysql 没有,是 php-mysqlnd