centos7 phpmyadmin mysql

参考链接: http://www.howtoforge.com/apache_php_mysql_on_centos_7_lamp


rpm


安装mysql
yum -y install mariadb-server mariadb
systemctl start mariadb.service
systemctl enable mariadb.service
mysql_secure_installation


安装httpd

yum -y install httpd
systemctl start httpd.service
firewall-cmd --permanent --zone=public --add-service=http 
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload


安装php
yum -y install php
systemctl restart httpd.service


安装php-mysql

选择适合本机的php-mysql
yum search php

搜索的结果
============================ N/S matched: php-mysql ============================
php-mysql.x86_64 : A module for PHP applications that use MySQL databases
php-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases

  Name and summary matches only, use "search all" for everything.



我选的是php-mysql.x86_64


yum -y install php-mysql.x86_64


安装php模块

yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel

systemctl restart httpd.service


安装phpmyadmin
yum install phpMyAdmin


修改配置文件

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


将默认的配置注释掉
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

#<Directory /usr/share/phpMyAdmin/>
#   <IfModule mod_authz_core.c>
#     # Apache 2.4
#     <RequireAny>
#       Require ip 127.0.0.1
#       Require ip ::1
#     </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/>
        Options none
        AllowOverride Limit
        Require all granted
</Directory>


重启httpd
systemctl restart  httpd.service


现在phpmyadmin应该安装完成了。

可以访问http://localhost/phpmyadmin 了。

猜你喜欢

转载自xkorey.iteye.com/blog/2118271