欢迎来到DIVCSS5查找CSS资料与学习DIV CSS布局技术!

Linux centos7 安装 phpMyAdmin

yum install httpd php mariadb-server –y
搭建lamp运行环境之后安装phpMyAdmin遇到的一些问题记录一下

 

1.官网下载phpMyAdmin压缩包

wget -c https://files.phpmyadmin.net/phpMyAdmin/4.9.3/phpMyAdmin-4.9.3-all-languages.tar.gz

 

2.解压缩到/var/www/html/

tar -zxvf phpMyAdmin-4.9.3-all-languages.tar.gz -C /var/www/html/

 

3.重命名

cd /var/www/html/
mv phpMyAdmin-4.9.3-all-languages phpMyAdmin

到这一步一般都可以正常通过localhost/phpMyAdmin访问了,但是有时候总会出现些其他问题。

 

4.进入到phpMyAdmin安装目录下复制phpmyadmin的简单配置文件config.sample.inc.php,作为默认配置文件config.inc.php

复制文件
cp config.sample.inc.php  config.inc.php

编辑配置文件
vim config.inc.php

配置文件现在需要一个短语密码,找到
$cfg['blowfish_secret'] = ''; //这里随意添加几个字符太短会有错误提示。
$cfg['Servers'][$i]['auth_type'] = 'cookie'; //这里默认就好
$cfg['Servers'][$i]['host'] = 'localhost'; //这里可以改为自己的ip地址或者域名,不改也没关系

 

5.如果出现错误提示

变量 $cfg['TempDir'] (./tmp/)无法访问。phpMyAdmin无法缓存模板文件,所以会运行缓慢。

在phpMyAdmin目录下新建tmp文件夹
mkdir tmp
chmod 777 tmp

 

6.可能会提示缺少一些扩展程序

安装php链接数据库的扩展程序包

yum install php-mysql

安装支持多字节字符串扩展的程序包

yum install php-mbstring -y

安装支持多加密扩展的程序包

yum install php-mcrypt –y

 

7.其他电脑访问需要开启80端口或关闭防火墙

开启80端口 
firewall-cmd --zone=public --add-port=80/tcp --permanent
//--zone作用域,--add-port=80/tcp添加端口/协议,--permanent永久生效
重启防火墙
systemctl restart firewalld


或者干脆直接关闭防火墙
查看防火墙状态
systemctl status firewalld
停止防火墙
systemctl stop firewalld
关闭开启启动防火墙
systemctl disable firewalld

 

8.如果出现Forbidden提示没有权限访问,可能是被selinux阻止了

查看SELinux是否运行
gettenforce
如果是
enforcing    //强制模式,会限制domain/type
permissive    //宽容模式,会有警告但不限制domain/type
disabled    //关闭状态,没有运行

settenforce 0    //转换成宽容模式,相当于临时关闭SELinuxx
settenforce 1    //转换成强制模式

设置SELINUX=disables 可以设置开机不启动
vim /etc/selinux/config

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/html/h58116.shtml