30

Hi Friends previously I am using XAMP Server but when I install joomla Templates it creates alots of error. Now I installed the WAMP, but the issues are: 1. I can access with 127.0.0.1, but I cant access with "localhost". 2 When i access phpmyadmin i get this error.

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

 Alias /phpmyadmin "c:/wamp/apps/phpmyadmin3.4.5/" 

# to give access to phpmyadmin from outside 
# replace the lines
#
#        Order Deny,Allow
#   Deny from all
#   Allow from 127.0.0.1
#
# by
#
#        Order Allow,Deny 
#   Allow from all
#

After changing, it will look like this

<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Deny,Allow
        Allow from all
</Directory>

After this just restart Wamp

Shamas
  • 1,027
  • 2
  • 10
  • 10
  • On behalf of Sreeraj, Check the path containing phpmyadminversion number in Change the file content of c:\wamp\alias\phpmyadmin.conf to the following. and the starting point.. – yizzlez Apr 13 '14 at 21:45
  • 3
    Possible duplicate of [WAMP error: Forbidden You don't have permission to access /phpmyadmin/ on this server](https://stackoverflow.com/questions/8366976/wamp-error-forbidden-you-dont-have-permission-to-access-phpmyadmin-on-this-s) – Akhil Thayyil Jul 06 '17 at 04:13

15 Answers15

40

Go to C:\wamp\alias. Open the file phpmyadmin.conf and change

<Directory "c:/wamp/apps/phpmyadmin3.5.1/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

to

<Directory "c:/wamp/apps/phpmyadmin3.5.1/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Allow,Deny
    Allow from all
</Directory>

problem solved

khagler
  • 3,996
  • 29
  • 40
dipo
  • 432
  • 5
  • 2
  • 21
    "problem solved" and added another bigger one. Now phpMyAdmin (the database) is public and anyone can connect to it. Good job. – oxygen May 07 '13 at 18:35
  • 3
    `Allow from ::1` is the correct solution on systems where localhost points to an IPv6 address. – oxygen Dec 01 '13 at 18:22
26

Change httpd.conf file as follows:

from

<Directory />
    AllowOverride none
    Require all denied
</Directory>

to

<Directory />
    AllowOverride none
    Require all granted
</Directory>
Griwes
  • 8,805
  • 2
  • 43
  • 70
kaka
  • 269
  • 2
  • 2
13

So none of the above stuff worked for me. Except this: edit httpd.conf,

find the line

Listen 80 

and change to

listen 0.0.0.0:80 

if you are running windows 8, its got something to do with using ipv6 instead of ipv4

Soviut
  • 88,194
  • 49
  • 192
  • 260
decoder88
  • 480
  • 4
  • 6
  • This was the solution for me after trying all of the above and more. Thank you. – 4Dev Oct 17 '14 at 12:44
  • 1
    @4Dev Then your issue was probably that you did not have this line `::1 localhost` in your HOSTS file. If the browser attempts to use the IPV6 network which they do more and more now this is required. The `listen 0.0.0.0:80` just tells apache to ONLY Listen on the IPV4 network – RiggsFolly May 09 '16 at 10:33
  • Great. Worked perfectly. Thanks a lot. – Sumith Harshan Jun 30 '16 at 06:05
9

Go to C:\wamp\alias. Open the file phpmyadmin.conf and add

Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from MACHINE_IP
Soviut
  • 88,194
  • 49
  • 192
  • 260
Shin
  • 280
  • 1
  • 2
  • 11
7

Change in following file \bin\apache\apache2.2.22\conf\httpd.conf

Replace Listen 80 with Listen 0.0.0.0:80

Replace

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

with

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow from all
</Directory>

Replace

onlineoffline tag - don't remove

Order Deny,Allow
Deny from all
Allow from 127.0.0.1

with

onlineoffline tag - don't remove

Order Deny,Allow
Allow from all
Allow from 127.0.0.1

in \wamp\alias\phpmyadmin.conf replace

<Directory "c:/wamp/apps/phpmyadmin3.4.10.1/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

with

<Directory "c:/wamp/apps/phpmyadmin3.4.10.1/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
    Allow from ::1
</Directory>

Tested on windows localhost. Note : Please consider RigsFolly's comment also.

Mukesh
  • 7,630
  • 21
  • 105
  • 159
  • **Never ever** amend the section starting `` to `Require all granted` That allows a hacked Apache access to the whole disk !!!!!! – RiggsFolly Apr 23 '16 at 10:40
  • @RiggsFolly Did you mean this c:/wamp/apps/phpmyadmin3.4.10.1/ should not be added in tag ? – Mukesh May 09 '16 at 10:17
  • No! The section that starts `` that is the section that controls access to the root of the drive Apache is installed on. Standard practice with Apache, lock everything out, then allow access ONLY WHERE IT IS NEEDED – RiggsFolly May 09 '16 at 10:30
  • @RiggsFolly sorry, I am not getting, could you elaborate more or add code to comment. – Mukesh May 09 '16 at 12:01
  • 1
    This part of your answer ` Options FollowSymLinks AllowOverride None Order deny,allow Allow from all ` You should never make that `Allow from all` – RiggsFolly May 09 '16 at 12:04
  • Ok got it, I will try to find correct way and update the answer. – Mukesh May 09 '16 at 12:10
5

For WampServer 2.2 with Apache 2.4.2 I ended up with:

Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require local
nunomira
  • 390
  • 4
  • 14
3

To solve this, I opened httpd.conf and changed the following line:

Allow from 127.0.0.1

to:

Allow from 127.0.0.1 ::1
Kick Buttowski
  • 6,709
  • 13
  • 37
  • 58
tharindu_DG
  • 8,900
  • 6
  • 52
  • 64
2

I faced this problem

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

Some help about this:

First check you installed a fresh wamp or replace the existing one. If it's fresh there is no problem, For done existing installation.

Follow these steps.

  1. Open your wamp\bin\mysql directory
  2. Check if in this folder there is another folder of mysql with different name, if exists delete it.
  3. enter to remain mysql folder and delete files with duplication.
  4. start your wamp server again. Wamp will be working.
Federico Cristina
  • 2,203
  • 1
  • 19
  • 37
ubaidullah
  • 29
  • 2
  • Totally not necessary. Wamp is designed to allow you to have multiple versions of Apache/Php/Mysql on the same system and switch between them. See answer using Listen 0.0.0.0:80 to make apache listen only on IPV4 – RiggsFolly May 01 '13 at 10:00
2

just add following line in wamp/alias/phpmyadmin.conf
Allow from ::1

so it will look something like this depending your phpmyadmin version.

<Directory "c:/wamp/apps/phpmyadmin3.5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
    Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
</Directory> 
Zeel Shah
  • 462
  • 6
  • 15
1

If its possible uninstall wamp then run installation as administrator then change you mysql.conf file like that

<Directory "c:/wamp/apps/phpmyadmin3.5.1/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Allow,Deny
    Allow from all
    Allow from all
</Directory>

Not: Before I reinstall as admin the solution above didn't work for me

Ismail Sahin
  • 2,640
  • 5
  • 31
  • 58
1

Change the file content of c:\wamp\alias\phpmyadmin.conf to the following.

<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Deny,Allow
        Allow from all
</Directory>

Here my WAMP installation is in the c:\wamp folder. Change it according to your installation.

Previously, it was like this:

<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

Restart your Apache server after making these changes.

GIPSSTAR
  • 2,050
  • 1
  • 25
  • 20
0

In your apache config file (../bin/apachex.y.z/cong/httpd.conf)

Just change

< Directory "c:/wamp/www/" > ...
...

"Require local" ===> "Require all granted"
< /Directory >

This allows other pc's to access (to read) your web folder.

macmuri
  • 115
  • 7
  • **BAD SOLUTION** This will have the effect of allowing access to phpmyadmin and therefore ALL YOUR DATABASES to any ip i.e. the world! leave it as `Require local` and if you want to allow access from another PC on your internal networks add something like this `Require ip 192.168.0` – RiggsFolly Oct 21 '14 at 20:37
0

I had done below changes for new phpmyadmin4.0.4 in httpd.conf file

<Directory />
    AllowOverride none
    Require all granted
</Directory>

and phpmyadmin.conf

<Directory "c:/wamp/apps/phpmyadmin4.0.4/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Allow,Deny
    Allow from all
</Directory>

and restart my server.

Prashant Tapase
  • 2,132
  • 2
  • 25
  • 34
  • **Never ever** amend the section starting `` to `Require all granted` That allows a hacked Apache access to the whole disk !!!!!! – RiggsFolly Apr 23 '16 at 10:38
0

None of the above answers worked for me, or where unsafe (as some pointed out, using Allow from all can make your files and data accessible to the outside world).

Open the c:\wamp\alias\phpmyadmin.conf file and change

Allow from 127.0.0.1

to

Allow from 127.0.0.1  ::1

Explanation:

  • On most computer systems, localhost resolves to the IP address 127.0.0.1, which is the most commonly used IPv4 loopback address, and to the IPv6 loopback address ::1 (source: https://en.wikipedia.org/wiki/Localhost)
  • The resolution of the name localhost into one or more IP addresses is configured by the following lines in the operating system's hosts file:

    127.0.0.1    localhost
    ::1          localhost
    
  • to see your hosts file, go to c:\Windows\System32\drivers\etc\HOSTS

  • notice the above lines are commented out with the note: # localhost name resolution is handled within DNS itself.

On my machine, on Win7, I also noticed the following:

  • localhost\phpmyadmin did not work on Chrome, but worked on IE11
  • 127.0.0.1\phpmyadmin worked on Chrome
bg17aw
  • 2,818
  • 1
  • 21
  • 27
0

comment Require local from httpd.conf

"#Require local"

mzk10k
  • 394
  • 4
  • 4