0

installed php5,apache2,LAMP, PHPMyAdmin but if I type my IP and PHPMyAdmin like this http://__my_IP__/phpmyadmin it is showing the error

Forbidden
You don't have permission to access /PHPMyAdmin/ on this server.

I edited /etc/httpd/conf.d/phpmyadmin.conf this file also added my IP address and allow to my IP address, still it is showing above error,

my phpmyadmin.conf file is like this now

# phpMyAdmin - Web based MySQL browser written in php
#
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8

<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 27.34.248.3
#Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow

how can I access PHPMyAdmin folder, so that I can manage database easily, I'm using Redhat Linux 7.3, all packages are updated!

please help me!

1
  • Which user is running apache? Does the user have access rights to /usr/share/phpMyadmin?
    – Patrick R.
    Commented Feb 10, 2017 at 16:48

3 Answers 3

1

This works. Centos 7.

    <Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require all granted
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Allow from All
   </IfModule>
</Directory>
0

Try this configuration:

  <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 ip 27.34.248.3
   </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
   Allow from 27.34.248.3
  </IfModule>
  </Directory>

Restart the Apache service:

systemctl restart httpd
1
  • no sir, same error! I tried this also
    – rakcode
    Commented Feb 2, 2017 at 17:11
0

You need to change in apache config file of phpmyadmin

location is /etc/httpd/conf.d/phpMyAdmin.conf

Default Config is:

<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
     </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>

Change it to:

<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require all granted
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Allow from All
   </IfModule>
</Directory>

and restart apache using command

# service httpd restart

OR

# systemctl restart  httpd.service
1
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – Journeyman Geek
    Commented Feb 3, 2017 at 3:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .