通过yum安装phpMyAdmin及配置过程

【转】通过yum安装phpMyAdmin及配置过程

1. 安装mysql + php环境。

2. 安装phpMyAdmin

yum -y install phpMyAdmin

安装完成后如下配置:

配置文件在/usr/share/phpMyAdmin下,进入libraries目录
a. 修改/etc/phpMyAdmin/config.inc.php,,修改前应先备份一下

['host']='localhost';    //除非数据库不在本机,此处不要更改
['port']='';默认为3306
['auth_type']='config' 
['user']='YOUR_USER_NAME'
['password']='YOUR_PASSWORD'    //注意这里的user和password仅用于auth_type=config的情况下,
密码不要为空
['blowfish_secret']='php' cookie认证字符,可为任意,注意要不为空才行的

b. 修改/etc/httpd/conf.d/phpmyadmin.conf
本文件是phpmyadmin的访问控制文件,保证远程访问。如下修改即可:

<Directory /usr/share/phpMyAdmin/>

   Order Deny,Allow

   Deny  from All

   Allow from 127.0.0.1

   Allow from ipaddress

</Directory>



测试:
http://IP/phpMyAdmin/

c. 如果安装php时没有安装php-mcrypt包,可能会出现错误提示,这时只需将其安装:
yum -y install php-mcrypt

遇到
安装phpmyadmin报错 No package phpmyadmin available.时,按如下方案解决:

安装nginx报错No package nginx available

问题:安装nginx,报错如下

yum -y install nginx

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: centos.ustc.edu.cn
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: data.nicehosting.co.kr
Setting up Install Process
No package nginx available.
Nothing to do

原因:EPEL未被启动,且指示的 rpm包不可用

解决方法:1.首先检查系统是否安装epel-release:

[root@flc ~]# rpm -q epel-release
package epel-release is not installed

2.如果没有安装,则install:

[root@flc ~]# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Retrieving http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Preparing...                ########################################### [100%]
   1:epel-release           ########################################### [100%]

注意:

32位:http://mirrors.ustc.edu.cn/fedora/epel/6/i386/epel-release-6-6.noarch.rpm

64位:http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-6.noarch.rpm

#安装成功

[root@flc ~]# rpm -q epel-release
epel-release-6-8.noarch   

#查看其所依附的软件文件
[root@flc ~]# rpm -qR epel-release  
/bin/sh 

/bin/sh 

config(epel-release) = 6-8

redhat-release >= 6

rpmlib(CompressedFileNames) <= 3.0.4-1

rpmlib(FileDigests) <= 4.6.0-1

rpmlib(PayloadFilesHavePrefix) <= 4.0-1

rpmlib(PayloadIsXz) <= 5.2-1

3导入key:

[root@flc ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

别忘了安装yum-priorities

[root@flc ~]#yum install yum-priorities

[root@flc ~]#cd /etc/yum.repos.d

[root@localhost yum.repos.d]# ls |grep epel

epel.repo

epel-testing.repo


然后安装nginx,即不报错:

[root@wmct-server yum.repos.d]# yum install nginx


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值