centos7.9安装php7.4.30+nginx+apache+mysql

本文详细介绍了如何在Linux系统上安装PHP 7.4.30,配置Nginx、Apache及MySQL 5.7,并设置MySQL root用户的密码。过程包括安装EPEL和Remi RPM仓库,安装相关软件,以及无密码登录和密码修改步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装php7.4.30
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

rpm -Uvh epel-release-latest-7.noarch.rpm
rpm -Uvh remi-release-7.rpm

yum install yum-utils
yum-config-manager --enable remi-php74

yum -y install php74 php-cli php-common \
    php-devel php-gd php-json php-mbstring \
    php-mysqlnd php-pdo php-pear \
    php-pecl-zip php-process php-xml php-ldap

# php -v
PHP 7.4.30 (cli) (built: Jun  7 2022 08:38:19) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
安装nginx
]# yum -y install nginx

启动nginx
]# systemctl start nginx
安装httpd
]# yum -y install httpd
启动
]# httpd
安装mysql5.7
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.38-1.el7.x86_64.rpm-bundle.tar

]# tar -xvf mysql-5.7.38-1.el7.x86_64.rpm-bundle.tar

安装服务
]# rpm -ivh mysql-community-common-5.7.38-1.el7.x86_64.rpm
]# rpm -ivh mysql-community-libs-5.7.38-1.el7.x86_64.rpm
]# rpm -ivh mysql-community-client-5.7.38-1.el7.x86_64.rpm
]# rpm -ivh mysql-community-server-5.7.38-1.el7.x86_64.rpm
]# rpm -ivh mysql-community-devel-5.7.38-1.el7.x86_64.rpm

启动
]# service mysqld start
查看初始化密码
]# grep 'temporary password' /var/log/mysqld.log
2022-08-18T08:34:12.220988Z 1 [Note] A temporary password is generated for root@localhost: iNKuulhDa3=w

无密码登录
]# mysql -u root -p

修改密码

update mysql.user set authentication_string=password('xxxx') where user='root';
flush privileges;

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值