# phpmyadmin - forbidden



## balanga (Aug 28, 2014)

I'm in the process of setting up PhpMyAdmin and have come across numerous guides many of which show slightly conflicting advice.

At the moment I can access PhpMyAdmin via Apache but I get this message:


```
Forbidden

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

Is this due to my phpMyAdmin.conf which has 


```
Alias /phpmyadmin "/usr/local/www/phpMyAdmin/"
<Directory "/usr/local/www/phpMyAdmin/">
      Order deny,allow
      Allow from all
      Allow from 192.168.1.0/24
</Directory>
```

Does this setup explain the 'forbidden' message? Or should I look at something else like file permissions?


----------



## SirDice (Aug 28, 2014)

Does the site open if you add index.php at the end of the URL? If that's the case you may need to set DirectoryIndex.


----------



## balanga (Aug 28, 2014)

Looking at httpd-error.log. I see lots of lines complaining about 'Cannot open....'. For example .../php/20121212-zts/ctype.so which does not exist. I only have .../php/20121212/ctype.so. I guess I may have picked the wrong build options when building PHP . Not sure if that would create the 'forbidden' error though.


----------



## balanga (Aug 28, 2014)

After rebuilding PHP, I now get a different error in httpd-error.log..


```
'../sbin/httpd -D NOHTTPACCEPT'
```


----------



## SirDice (Aug 29, 2014)

It's not an error, it's a warning. Add to /boot/loader.conf:

```
accf_http_load="YES"
```
That will get rid of it.


----------



## quintessence (Sep 4, 2014)

Hello,

This block:


			
				balanga said:
			
		

> I'm in the process of setting up PhpMyAdmin and have come across numerous guides many of which show slightly conflicting advice.
> 
> ```
> Alias /phpmyadmin "/usr/local/www/phpMyAdmin/"
> ...



should look like:

```
Alias /phpmyadmin "/usr/local/www/phpMyAdmin/"
<Directory "/usr/local/www/phpMyAdmin/">
      Order deny,allow
      Deny from all
      Allow from 192.168.1.0/24 # your IP address(es) from which you would like to access PHPMyAdmin
</Directory>
```

http://httpd.apache.org/docs/2.2/howto/access.html


----------



## SirDice (Sep 4, 2014)

On Apache 2.4 it would be something like:

```
Alias /phpmyadmin "/usr/local/www/phpMyAdmin/"
<Directory "/usr/local/www/phpMyAdmin/">
 Require ip 192.168.1.0/24
</Directory>
```


----------



## zzatskl (Feb 5, 2015)

I struggled for a while with this problem on a reinstall of www/apache24, then remembered I had to install:

www/mod_php5


----------



## abdelilah (Jul 14, 2015)

Thanks for the help.

```
Require ip 192.168
```
Did the trick.


----------

