标签:var 添加 org centos7 evel .com 1.7 文本编辑 登陆
CentOS 7.x 安装apache
[root@localhost ~]#yum -y install httpd httpd-devel
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl enable httpd
CentOS 7.x 安装 Mariadb 数据库
[root@localhost ~]# yum -y install mariadb mariadb-server mariadb-libs mariadb-devel
[root@localhost ~]# systemctl start mariadb [root@localhost ~]# systemctl enable mariadb
数据库安全设置:
[root@localhost ~]# mysql_secure_installation
登陆数据库:
[root@localhost ~]# mysql -uroot -p
Centos7.x 使用yum安装php7
1.安装epel-release
通过命令:
yum -y install epel-release
成功安装。
2.安装PHP7
终端再次运行如下命令:
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
成功获取PHP7的yum源,然后再执行:
yum -y install php70w
Centos7.x 使用yum安装php7.2
1、如果之前已经安装低版本php,先卸载:
[root@localhost ~]#yum -y remove php*
2、由于linux的yum源不存在php7.x,所以我们要更改yum源
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
3、yum 安装php72w和各种拓展模块,选自己需要的即可
yum -y install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml
4、最后,写一个PHP探测指针,测试PHP:
[root@localhost ~]#cd /var/www/html/
[root@localhost ~]#vi info.php
<?php
phpinfo();
?>
保存并退出
5、重启apache服务器:
[root@localhost ~]# systemctl restart httpd
6、访问 http://localhost/info.php
*将php与数据库关联:
[root@localhost ~]#yum install php-mysql
CentOS 7.x 安装phpmyadmin
1、先安装epel,不然安装pgpmyadmin时会出现找不到包。
[root@localhost ~]# yum install epel-release
[root@localhost ~]# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
2、[root@localhost ~]# sudo yum install phpmyadmin
3、用文本编辑器打开phpMyAdmin的配置文件(路径:/etc/httpd/conf.d/phpMyAdmin.conf),找出并注释掉带有"Require ip XXXX"字样的代码行。会有四处这样的代码行,用"Require all granted"取而代之
[root@localhost ~]# sudo vi /etc/httpd/conf.d/phpMyAdmin.conf
修改后的文件内容
- <Directory /usr/share/phpMyAdmin/>
- AddDefaultCharset UTF-8
- <IfModule mod_authz_core.c>
- # Apache 2.4
- <RequireAny>
- # Require ip 127.0.0.1 #注释掉
- # Require ip ::1 #注释掉
- Require all granted #新添加
- </RequireAny>
- </IfModule>
- <IfModule !mod_authz_core.c>
- # Apache 2.2
- Order Deny,Allow
- Deny from All
- Allow from 127.0.0.1
- Allow from ::1
- </IfModule>
- </Directory>
- <Directory /usr/share/phpMyAdmin/setup/>
- <IfModule mod_authz_core.c>
- # Apache 2.4
- <RequireAny>
- #Require ip 127.0.0.1 #注释掉
- #Require ip ::1 #注释掉
- Require all granted #新添加
- </RequireAny>
- </IfModule>
- <IfModule !mod_authz_core.c>
- # Apache 2.2
- Order Deny,Allow
- Deny from All
- Allow from 127.0.0.1
- Allow from ::1
- </IfModule>
- </Directory>
4、[root@localhost ~]# systemctl restart httpd
CentOS 7.x 安装LAMP
标签:var 添加 org centos7 evel .com 1.7 文本编辑 登陆
原文地址:https://www.cnblogs.com/ponfey/p/9771086.html