標題:
[文章] CentOS 7 上安裝 PHP 7.4 + nginx 1.2 + Composer2 + MySQL 8.0
[打印本頁]
作者:
99770
時間:
2022-9-29 08:43
標題:
CentOS 7 上安裝 PHP 7.4 + nginx 1.2 + Composer2 + MySQL 8.0
新增Remi repository
# yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
# yum install epel-release yum-utils
開啟PHP 7.4
# yum-config-manager --enable remi-php74
(1)安裝PHP 7.4
# yum install php php-devel php-xmlrpc php-bcmath php-recode php-pdo php-mysqlnd php-enchant php-common php-cli php-gd php-embedded php-ldap php-process php-pecl-zip php-pgsql php-dba php-json php-soap php-fpm php-pear php-odbc php-intl php-xml php-snmp php-mbstring php-imagick
驗證
# php -v
(2)安裝nginx 1.20
# yum install nginx
# nginx -v
nginx version: nginx/1.20.1
(3)安裝 git
# yum install git
(4)安裝 Composer 2
# php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
將 Composer 安裝到 /usr/local/bin,成為系統可直接使用的指令
# php composer-setup.php --install-dir=/usr/local/bin --filename=composer
用 composer 指令確認是否安裝成功,出現版本號就是成功了」
# composer -V
Composer version 2.4.2 2022-09-14 16:11:15
(5)安裝 MySQL 8.0
# yum localinstall https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
# rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
# yum install mysql-community-server
# systemctl enable mysqld
# systemctl start mysqld
首次啟動 MySQL服物器時,將為 MySQL root用户生成一个臨時密碼。您可以通過運行命令底下指令來找到密碼。
# grep 'temporary password' /var/log/mysqld.log
# mysql -u root -p
下面將使用第一個選項運行ALTER USER SQL語句使root用戶使用密碼進行身份驗證。
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码';
FLUSH PRIVILEGES;
這樣就可以囉~
歡迎光臨 ADJ網路實驗室 (http://dz.adj.idv.tw/)
Powered by Discuz! 6.0.0