查看完整版本: 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<br># yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm<br># yum install epel-release yum-utils<br><br>開啟PHP 7.4<br># yum-config-manager --enable remi-php74<br><br>(1)安裝PHP 7.4<br># 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<br><br>驗證<br># php -v<br><br>(2)安裝nginx 1.20<br><br># yum install nginx<br><br># nginx -v<br>nginx version: nginx/1.20.1<br><br><br>(3)安裝 git<br># yum install git<br><br>(4)安裝 Composer 2<br># php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"<br><br>將 Composer 安裝到 /usr/local/bin,成為系統可直接使用的指令<br># php composer-setup.php --install-dir=/usr/local/bin --filename=composer<br><br>用 composer 指令確認是否安裝成功,出現版本號就是成功了」<br># composer -V<br>Composer version 2.4.2 2022-09-14 16:11:15<br><br>(5)安裝 MySQL 8.0<br># yum localinstall https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm<br># rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022<br># yum install mysql-community-server<br># systemctl enable mysqld<br># systemctl start mysqld<br><br>首次啟動 MySQL服物器時,將為 MySQL root用户生成一个臨時密碼。您可以通過運行命令底下指令來找到密碼。<br># grep 'temporary password' /var/log/mysqld.log<br><br># mysql -u root -p<br><br>下面將使用第一個選項運行ALTER USER SQL語句使root用戶使用密碼進行身份驗證。<br><br>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码';<br>FLUSH PRIVILEGES;<br><div><br></div><div><span style="color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">這樣就可以囉~</span></div>
頁: [1]
查看完整版本: CentOS 7 上安裝 PHP 7.4 + nginx 1.2 + Composer2 + MySQL 8.0