centos 7.4 yum 安裝apache mysql php

1.安裝apache httpdphp

[root@zlhcec ~]# yum install httpd -y

  

啓動apachehtml

systemctl start httpd.servicemysql

 

 

檢測是否啓動sql

 curl 測試下apache

curl localhost  出現如下信息說明就是能夠的了centos

 

2.安裝phpcurl

 

如下是CentOS 7.0的源。ide

yum install epel-releasephp-fpm

rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm測試

使用yum list命令查看可安裝的包(Packege)。

yum list --enablerepo=remi --enablerepo=remi-php56 | grep php

[root@zlhcec ~]# yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof

yum install --enablerepo=remi,remi-php56 php php-opcache php-pecl-apcu php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-pdo php-pear php-fpm php-cli php-xml php-bcmath php-process php-gd php-common  

 

 

查找php.ini

找到date.timezone = PRC 去掉分號 後面加上PRC

vi /etc/php.ini

搜索timezone  輸入 / 而後回車找到 位置

修改 按 I 鍵 修改後 

ESC 

:wq保存

 

 

 

查找確認apache配置文件目錄和安裝目錄

 

 

Apache的主配置文件:/etc/httpd/conf/httpd.conf

默認站點主目錄:/var/www/html/

 

重啓apache

systemctl restart   httpd.service

 

1)wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm

 2)rpm -ivh mysql57-community-release-el7-8.noarch.rpm

安裝 MySQL

3)yum install -y mysql-server

4)啓動mysql

[root@zlhcec src]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service

 5)查看初始登錄密碼

 

[root@zlhcec src]# grep "password" /var/log/mysqld.log
2018-06-04T08:54:37.112227Z 1 [Note] A temporary password is generated for root@localhost: tauwHVrw7r=v

 

查找下

 

cd /usr/bin

mysql -u root -p

輸入上面找的密碼

LAMP 安裝(centos7+mysql5.7+apache+php5.6)

 

 修改密碼mysql密碼

修改的密碼要大於8位 要有大小寫 數字 字母和特殊符號

mysql> alter user 'root'@'localhost' identified by 'ZiXun!201806#zlh';
Query OK, 0 rows affected (0.00 sec)

 

參考資料

 

CentOS 7 yum 安裝php5.6

相關文章
相關標籤/搜索