栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

PHP8.0+Mariadb10.5+apache2.4安装配置步骤

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

PHP8.0+Mariadb10.5+apache2.4安装配置步骤

1、 更换阿里云yum源并安装epel源

[root@localhost ~]# yum -y install vim wget
[root@localhost ~]#  mv /etc/yum.repos.d//CentOS-base.repo /etc/yum.repos.d/CentOS-base.repo.backup
[root@localhost ~]# wget  http://mirrors.aliyun.com/repo/Centos-7.repo -O /etc/yum.repos.d/CentOS-base.repo
[root@localhost ~]# yum -y install epel-release
[root@localhost ~]# yum -y update

2、安装apache-2.4.6,启动服务后并进行验证

[root@localhost ~]# yum -y install httpd httpd-devel
[root@localhost ~]# systemctl start httpd && systemctl enable httpd
[root@localhost ~]# httpd -v


3、配置防火墙

[root@localhost ~]# firewall-cmd --zone=public --permanent --add-service=http
[root@localhost ~]# systemctl restart firewalld
[root@localhost ~]# firewall-cmd --list-all


访问浏览器能看到apache测试页面
4、安装数据库mariadb10.5.8

先将系统自带的旧版本mariadb的相关包移除

[root@localhost ~]# yum list installed | grep mariadb

[root@localhost ~]# yum remove mariadb-libs.x86_64

创建mariadb最新版本的yum源

[root@localhost ~]# vim /etc/yum.repos.d/mariadb.repo

[root@localhost ~]# yum clean all && yum makecache
[root@localhost ~]# yum list | grep mariadb

 [root@localhost ~]# yum -y install MariaDB-server MariaDB-client
 [root@localhost ~]# yum -y install net-tools
 [root@localhost ~]# systemctl enable mariadb --now
 [root@localhost ~]#  netstat -anptu | grep :3306


配置mariadb10.5数据库密码等

[root@localhost ~]#  mysql_secure_installation

[root@localhost ~]# vim /etc/my.cnf
[mysqld]

init_connect='SET collation_connection = utf8_general_ci'

init_connect='SET NAMES utf8'

character-set-server=utf8

collation-server=utf8_general_ci

skip-character-set-client-handshake

[root@localhost ~]# vim /etc/my.cnf.d/client.cnf
default-character-set=utf8
[root@localhost ~]# cat /etc/my.cnf.d/client.cnf

[root@localhost ~]# vim /etc/my.cnf.d/mysql-clients.cnf
#
# These groups are read by MariaDB command-line tools
# Use it for options that affect only one utility
#

[mysql]
default-character-set=utf8

[mysql_upgrade]

[mysqladmin]

[mysqlbinlog]

[mysqlcheck]

[mysqldump]

[mysqlimport]

[mysqlshow]

[mysqlslap]

[root@localhost ~]# cat /etc/my.cnf.d/mysql-clients.cnf

[root@localhost ~]# systemctl restart mariadb
[root@localhost ~]# mysql -uroot -p
MariaDB [(none)]> show variables like "%character%";

如上图所示mariadb安装完成。

安装php-8.0

[root@localhost ~]# yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
[root@localhost ~]# yum clean all && yum makecache

[root@localhost ~]# yum -y install yum-utils
[root@glocalhost ~]# yum repolist all |grep php

[root@localhost ~]#  yum-config-manager --enable remi-php80

安装php-80以及扩展包

[root@localhost ~]# yum -y install php  php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json php-redis php-fileinfo php-mysqli php-session php-zlib php-simplexml php-intl php-domxml php-ldap  php-openssl php-xmlrpc php-pecl-apcu php-pear-CAS php-opcache 
[root@localhost ~]# php -v
[root@localhost ~]# systemctl enable php-fpm --now
[root@localhost ~]# php --modules

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/395617.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号