1. 程式人生 > >Centos7.4環境下配置PHP新版環境+PHPmyadmin

Centos7.4環境下配置PHP新版環境+PHPmyadmin

一、yum原始檔更新

yum   -y   update

二、安裝PHP7

 rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm

 rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

 yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64

三、安裝PHP FPM

 yum install php70w-fpm

systemctl   start     php-fpm.service

設定開機啟動

systemctl  enable    php-fpm.service

四、安裝Apache

yum   install   httpd

systemctl   enable  httpd

systemctl   start   httpd

五、安裝MySQL7

wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

 yum localinstall mysql57-community-release-el7-8.noarch.rpm

yum install mysql-community-server

systemctl   start   mysqld

systemctl    enable   mysqld

檢視MySQL7初始化密碼

grep 'temporary password' /var/log/mysqld.log


mysql   -u root -p 

輸入密碼登入

修改初始密碼

 ALTER USER 'root'@'localhost' IDENTIFIED BY '新密碼!';

設定遠端連結許可權

   GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密碼' WITH GRANT OPTION;

重啟生效

systemctl restart mysqld  

六、安裝phpMyadmin

yum   yum   install   phpmyadmin

修改phpmyadmin配置檔案

vi /etc/httpd/conf.d/phpMyAdmin.conf


儲存配置退出

重啟Apache

systemctl   restart   httpd

PHPmyadmin訪問地址:http://伺服器IP地址或域名/phpmyadmin/