Ошибка 403 phpmyadmin

Receiving ‘phpMyAdmin 403 forbidden error’? We can help you fix it.

This error message is normally caused due to improper PHP installation or due to configuration file trouble.

At Bobcares, we receive requests to fix the phpMyAdmin errors as a part of our Server Management Services.

Today, let’s see the causes and how our Support Engineers fix this error.

Why phpMyAdmin 403 forbidden error occurs?

Many of our customers install the phpMyAdmin in their Linux server(CentOS/RHEL/Debian). And sometimes, when they try to access the phpMyAdmin they land up with 403 forbidden errors.

The forbidden error means one doesn’t have the permission to access /phpMyAdmin/ on the server.

This error often occurs if customers install phpMyAdmin using or by apt-get. The default path of phpMyAdmin is /usr/share/phpmyadmin.

And etc/httpd/conf.d/phpmyadmin.conf is the apache configuration file path.

Also, there are many different reasons for this error to occur. This mainly includes an error in the PHP installation, adding any deny code in the configuration file and so on.

Here, is a screenshot of how the error message appears while accessing the phpMyAdmin.

phpmyadmin 403 forbidden

How we fix phpMyAdmin 403 forbidden error?

Till now we’ve discussed the error message and its causes. Now, let’s see how our Support Engineers fix this error message to our customers.

Recently, one of our customers approached us with an error message:

Forbidden

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

So our Support Engineers checked the configuration file of phpMyAdmin i.e. /etc/httpd/conf.d/phpmyadmin.conf which has the below lines:


Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1



Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1

The deny code in the above lines were causing trouble. So we removed those contents and re-updated the file as below


Allow from xx.x.x.x
Allow from ::1



Allow from xx.x.x.x
Allow from ::1

Then, we used the below command to restart Apache

systemctl restart httpd

Finally, this fixed the error.

[Need assistance in fixing phpMyAdmin errors? – We’ll help you]

Conclusion

In short, the 403 forbidden error in phpMyAdmin mainly occurs due to either PHP installation error or due to some error in the configuration file. Today, we saw how our Support Engineers fix this error.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = «owonCMyG5nEQ0aD71QM»;

1 2014-03-05 22:17:34

  • krosh1995
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2014-03-05
  • Сообщений: 7

Тема: Ошибка 403

Не Найдено

Запрошенный URL не найден на этом сервере.

Кроме того, 403 Forbidden ошибка произошла при попытке использовать ErrorDocument для обработки запроса.

Apache/2 Server на sadovod.u-gu.ru Порт 80

Подскажите что нужно делать чтобы исправить эту ситуацию.

2 Ответ от Hanut 2014-03-06 13:50:51

  • Hanut
  • Hanut
  • Модератор
  • На форуме
  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,726

Re: Ошибка 403

Посмотрите журналы ошибок веб сервера и проверьте корректность .htaccess файла, если он существует.

3 Ответ от krosh1995 2014-03-07 16:27:15 (изменено: krosh1995, 2014-03-07 16:40:08)

  • krosh1995
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2014-03-05
  • Сообщений: 7

Re: Ошибка 403

Я особ-ото не понимаю что тут .htaccess смотреть(((
И как просмотреть журнал ошибок искал но найти так и не смог.

4 Ответ от Hanut 2014-03-07 19:43:19

  • Hanut
  • Hanut
  • Модератор
  • На форуме
  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,726

Re: Ошибка 403

Журнал ошибок веб сервера — обычно файл с именем error.log.

В .htaccess файле надо смотреть нет ли в нем директив закрывающих каталог попадающих в журнал ошибок.

5 Ответ от krosh1995 2014-03-11 23:44:21

  • krosh1995
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2014-03-05
  • Сообщений: 7

Re: Ошибка 403

.htaccess тут вроде бы норм

DirectoryIndex index.php
RewriteEngine On

# Основной домен
RewriteCond %{HTTP_HOST} ^www.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

# Главная
RewriteRule ^index.html$ index.php [L]

# Правила
RewriteRule ^rules(/?)+$ index.php?menu=rules [L]

# Контакты
RewriteRule ^contacts(/?)+$ index.php?menu=contacts [L]

# Новости
RewriteRule ^news(/?)+$ index.php?menu=news [L]

# О нас
RewriteRule ^about(/?)+$ index.php?menu=about [L]

# Регистрация
RewriteRule ^signup/key/(.*)(/?)+$ index.php?menu=signup&key=$1 [L]
RewriteRule ^signup(/?)+$ index.php?menu=signup [L]

# Восстановление пароля
RewriteRule ^recovery(/?)+$ index.php?menu=recovery [L]

# Пользователи

RewriteRule ^users/([0-9]+)(/?)+$ index.php?menu=users&page=$1 [L]
RewriteRule ^users(/?)+$ index.php?menu=users [L]

# Аккаунт
RewriteRule ^account/lottery/winners(/?)+$ index.php?menu=account&sel=lottery&winners [L]
RewriteRule ^account/lottery(/?)+$ index.php?menu=account&sel=lottery [L]
RewriteRule ^account/bonus(/?)+$ index.php?menu=account&sel=bonus [L]
RewriteRule ^account/config(/?)+$ index.php?menu=account&sel=config [L]
RewriteRule ^account/insert(/?)+$ index.php?menu=account&sel=insert [L]
RewriteRule ^account/payment/([0-9]+)(/?)+$ index.php?menu=account&sel=payment&pay_id=$1 [L]
RewriteRule ^account/payment(/?)+$ index.php?menu=account&sel=payment [L]
RewriteRule ^account/market(/?)+$ index.php?menu=account&sel=market [L]
RewriteRule ^account/swap(/?)+$ index.php?menu=account&sel=swap [L]
RewriteRule ^account/store(/?)+$ index.php?menu=account&sel=store [L]
RewriteRule ^account/referals(/?)+$ index.php?menu=account&sel=referals [L]
RewriteRule ^account/farm(/?)+$ index.php?menu=account&sel=farm [L]
RewriteRule ^account/exit(/?)+$ index.php?menu=account&sel=exit [L]
RewriteRule ^account(/?)+$ index.php?menu=account [L]

6 Ответ от krosh1995 2014-03-11 23:48:21

  • krosh1995
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2014-03-05
  • Сообщений: 7

Re: Ошибка 403

а вот error.log  я такого файла ненашол

7 Ответ от Hanut 2014-03-12 13:42:13

  • Hanut
  • Hanut
  • Модератор
  • На форуме
  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,726

Re: Ошибка 403

403 ответ означает, что каталог в который вы пытаетесь отрыть — закрыт директивами сервера. Чтобы хоть как-то найти что его блокирует необходимо посмотреть отдаваемые сервером ошибки.

8 Ответ от krosh1995 2014-03-15 07:21:06 (изменено: krosh1995, 2014-03-15 07:43:41)

  • krosh1995
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2014-03-05
  • Сообщений: 7

Re: Ошибка 403

Все исправил теперь у меня выдает такую вот ошибку

Parse error: syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25

при входе в админ панель.
И еще у меня загружается только главная страница сайта перехожу по другим кнопкам на сайте выдает ошибку 404.

Вот нашел лог с ошибками я сам ничего не понимаю в нем но пытался исправлять.

[15-Mar-2014 00:20:54 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 20
[15-Mar-2014 00:21:07 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 20
[15-Mar-2014 00:32:15 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:32:20 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:32:40 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:32:42 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:38:03 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:38:04 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:46:43 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:46:49 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:47:39 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:50:26 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 01:07:19 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'krosh342_1'@'localhost' (using password: YES) in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:07:19 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:07:20 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'krosh342_1'@'localhost' (using password: YES) in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:07:20 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Lost connection to MySQL server at 'reading initial communication packet', system error: 104 in /home/krosh342/public_html/config.php on line 7
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 8
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 10
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/config.php on line 10
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 11
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/config.php on line 11
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 12
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/config.php on line 12
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 13
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/config.php on line 13
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/profilaction.php on line 3
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/profilaction.php on line 3
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_result() expects parameter 1 to be resource, boolean given in /home/krosh342/public_html/profilaction.php on line 4
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 24
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 24
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 26
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/config.php on line 26
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 27
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/config.php on line 27
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 28
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/config.php on line 28
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/sfb.php on line 257
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/sfb.php on line 257
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/krosh342/public_html/sfb.php on line 258
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/sfb.php on line 268
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/sfb.php on line 268
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/krosh342/public_html/sfb.php on line 269
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/krosh342/public_html/sfb.php on line 271
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/sfb.php on line 275
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/sfb.php on line 275
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/krosh342/public_html/sfb.php on line 276
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/sfb.php on line 414
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/sfb.php on line 414
[15-Mar-2014 01:10:13 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'krosh342_1'@'localhost' (using password: YES) in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:13 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:40 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'krosh342_1'@'localhost' (using password: YES) in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:40 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:42 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'krosh342_1'@'localhost' (using password: YES) in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:42 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:47 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'krosh342_1'@'localhost' (using password: YES) in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:47 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:52 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'krosh342_1'@'localhost' (using password: YES) in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:52 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:56 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'krosh342_1'@'localhost' (using password: YES) in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:56 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 17 

9 Ответ от krosh1995 2014-03-15 10:33:24

  • krosh1995
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2014-03-05
  • Сообщений: 7

Re: Ошибка 403

krosh1995 сказал:

Все исправил теперь у меня выдает такую вот ошибку

Parse error: syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25

при входе в админ панель.
И еще у меня загружается только главная страница сайта перехожу по другим кнопкам на сайте выдает ошибку 404.

Вот нашел лог с ошибками я сам ничего не понимаю в нем но пытался исправлять.

[15-Mar-2014 00:20:54 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 20
[15-Mar-2014 00:21:07 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 20
[15-Mar-2014 00:32:15 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:32:20 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:32:40 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:32:42 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:38:03 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:38:04 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:46:43 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:46:49 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:47:39 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 00:50:26 UTC] PHP Parse error:  syntax error, unexpected $end in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 01:07:19 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'krosh342_1'@'localhost' (using password: YES) in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:07:19 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:07:20 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'krosh342_1'@'localhost' (using password: YES) in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:07:20 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Lost connection to MySQL server at 'reading initial communication packet', system error: 104 in /home/krosh342/public_html/config.php on line 7
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 8
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 10
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/config.php on line 10
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 11
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/config.php on line 11
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 12
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/config.php on line 12
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 13
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/config.php on line 13
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/profilaction.php on line 3
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/profilaction.php on line 3
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_result() expects parameter 1 to be resource, boolean given in /home/krosh342/public_html/profilaction.php on line 4
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 24
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 24
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/config.php on line 25
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 26
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/config.php on line 26
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 27
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/config.php on line 27
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/config.php on line 28
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/config.php on line 28
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/sfb.php on line 257
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/sfb.php on line 257
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/krosh342/public_html/sfb.php on line 258
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/sfb.php on line 268
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/sfb.php on line 268
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/krosh342/public_html/sfb.php on line 269
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/krosh342/public_html/sfb.php on line 271
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/sfb.php on line 275
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/sfb.php on line 275
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/krosh342/public_html/sfb.php on line 276
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/krosh342/public_html/sfb.php on line 414
[15-Mar-2014 01:09:11 UTC] PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/krosh342/public_html/sfb.php on line 414
[15-Mar-2014 01:10:13 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'krosh342_1'@'localhost' (using password: YES) in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:13 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:40 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'krosh342_1'@'localhost' (using password: YES) in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:40 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:42 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'krosh342_1'@'localhost' (using password: YES) in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:42 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:47 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'krosh342_1'@'localhost' (using password: YES) in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:47 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:52 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'krosh342_1'@'localhost' (using password: YES) in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:52 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:56 UTC] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'krosh342_1'@'localhost' (using password: YES) in /home/krosh342/public_html/config.php on line 17
[15-Mar-2014 01:10:56 UTC] PHP Warning:  mysql_select_db() expects parameter 2 to be resource, boolean given in /home/krosh342/public_html/config.php on line 17 

Не дождавшись ответа сам исправил ошибку это было не легко для моего мозга))) зато сам)) для этого я сделал 1. перезалил скрипт 2. изменил .htaccess и все заработало)

php-code-logo2.jpg phpMyAdmin: HTTP 403 (Forbidden); В конфигурационном файле необходимо задать парольную фразу (blowfish_secret); The configuration file now needs a secret passphrase (blowfish_secret).

Разбор всевозможных ошибок РНР и способов их решения.

  1. phpMyAdmin HTTP 403 (Forbidden)
  2. phpMyAdmin blowfish_secret
    1. 1. Отсутствует config.inc.php
    2. 2. А дальше mod_security не пускает
    3. 3. config.inc.php не в том месте
    4. 4. open_basedir restrictions
    5. 5. Протереть монитор, выдавить стекло

phpMyAdmin HTTP 403 (Forbidden)

Читаем журнал сервера:

script does not have ExecCGI enabled

$ sudo less /home/www/.logs/www-error.log|grep phpmyad|less
[Fri Aug 05 04:50:40.166650 2022] [fcgid:error] [pid 29625:tid 140391388202752]
[client 186.134.15.29:59762] mod_fcgid: location of script /usr/share/phpmyadmin
/index.php does not have ExecCGI enabled

Добавляем недостающее ExecCGI

$ sudo vi /etc/phpmyadmin/apache.conf
# phpMyAdmin default Apache configuration
 
Alias /phpmyadmin /usr/share/phpmyadmin
 
<Directory /usr/share/phpmyadmin>
    Options +FollowSymLinks +ExecCGI
    DirectoryIndex index.php
 
    AuthUserFile "/var/www/.htpasswd"
    AuthName "Administrator only"
    AuthType Basic
    require valid-user
    Satisfy all
 
    ...
</Directory>

ещё одной из причин может оказаться mod_security, как оно выключается будет далее…

phpMyAdmin blowfish_secret

В конфигурационном файле необходимо задать парольную фразу (blowfish_secret).

The configuration file now needs a secret passphrase (blowfish_secret).

Весёлая история, особенно если phpMyAdmin устанавливался не вручную, а из пакетов…

Требования к blowfish_secret:

  1. определяется в config.inc.php корневой директории phpmyadmin;
  2. должно быть не менее 32 символов

1. Отсутствует config.inc.php

По-умолчанию файл конфигурации /usr/share/phpmyadmin/config.inc.php в корневой директории phpmyadmin отсутствует — тут всё понятно, скопировали:

$ sudo cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php

Отредактировали:

$ sudo vi /usr/share/phpmyadmin/config.inc.php
 
/**
 * This is needed for cookie based authentication to encrypt password in
 * cookie. Needs to be 32 chars long.
 */
$cfg['blowfish_secret'] = 'viyie0quoo1oobie5ai4othohQui6zeo'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

Не помогло? Поехали дальше…

2. А дальше mod_security не пускает

Отключаем

$ sudo vi /etc/phpmyadmin/apache.conf
 
<Directory /usr/share/phpmyadmin>
    ...
    <IfModule security2_module>
        SecRuleEngine Off
        SecRuleRemoveById 920350 980130 949110 942140 200004
    </IfModule>
</Directory>

Опять не помогло? От phpMyAdmin-а маму…

3. config.inc.php не в том месте

Так тоже бывает, ой как бывает…

$ sudo vi /usr/share/phpmyadmin/libraries/vendor_config.php
 
/**
 * Directory where configuration files are stored.
 * It is not used directly in code, just a convenient
 * define used further in this file.
 */
define('CONFIG_DIR', '/etc/phpmyadmin/');
 
/**
 * Filename of a configuration file.
 */
define('CONFIG_FILE', CONFIG_DIR . 'config.inc.php');

Оказывается config.inc.php ожидается в /etc/phpmyadmin/ — передвигаем

$ sudo mv /usr/share/phpmyadmin/config.inc.php /etc/phpmyadmin/

Проверяем, ну, как? Снова не? От йоханый phpMyAdmin, разорви его ракета…

4. open_basedir restrictions

$ sudo less /home/www/.logs/www-access.log|grep access|less
...
[05-Aug-2022 06:24:53 Europe/Helsinki] phpmyadmin: Failed to load /var/lib/phpmyadmin/blowfish_secret.inc.php Check group www-data has read access and open_basedir restrictions.
[05-Aug-2022 06:24:53 Europe/Helsinki] phpmyadmin: Failed to load /var/lib/phpmyadmin/config.inc.php Check group www-data has read access and open_basedir restrictions.
[05-Aug-2022 06:24:53 Europe/Helsinki] phpmyadmin: Failed to load /etc/phpmyadmin/config-db.php Check group www-data has read access and open_basedir restrictions.

Думаю понятно, что нужно делать? php.ini у каждого хоста своё, находим там open_basedir и добавляем туда /var/lib/phpmyadmin/ и /etc/phpmyadmin/

; open_basedir, if set, limits all file operations to the defined directory
; and below.  This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file.
; http://php.net/open-basedir
;open_basedir =
open_basedir = /home/www:/usr/local/lib/php:/usr/lib/php:/usr/local/lib/php5:/usr/lib/php5:/proc:/usr/share:/var/lib:/etc/phpmyadmin:/usr/share/phpmyadmin

Ну, как, теперь арбайтен? НаАайн???

5. Протереть монитор, выдавить стекло

Ну.., тогда.., как нас уверят многие «копирасты», переменную $cfg[‘blowfish_secret’] указать именно в определённом порядке следования:

Если описанные выше способы не помогают, то точно выручит следующее:

Созданный ранее конфиг удаляем, чтобы не мешался и не влиял на работу того, что и без него работало:

# rm /usr/share/phpmyadmin/config.inc.php

Открываем реальный конфиг phpMyAdmin, который находится тут → /etc/phpmyadmin/config.inc.php и дописываем куда-нибудь в конец строку с переменной $cfg[‘blowfish_secret’], например, после этих двух строчек:

$cfg[‘UploadDir’] = »;
$cfg[‘SaveDir’] = »;
$cfg[‘blowfish_secret’] = ‘12345678901234567890123456789012’;

После этого ошибка в phpMyAdmin больше не появляется.

А чтобы 100%-я капитальная полная гарантия, вдобавок перезапустить браузер или перезагрузить весь ПК сразу — тогда уж точно всё вмиг засияет! :))

I had phpmyadmin installed but when i was on the site : ip/phpmyadmin i tried to logon, but i couldent, it would not redirect me so I removed it and reinstalled.

From then on I cant even connected to the site. In the /etc/httpd/phpMyAdmin.conf file I have added my ips four times like so…

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

# These directories do not require access over HTTP - taken from the original
# phpMyAdmin upstream tarball
#
<Directory /usr/share/phpMyAdmin/libraries/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/lib/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/frames/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc.  This may break your mod_security implementation.
#
#<IfModule mod_security.c>
#    <Directory /usr/share/phpMyAdmin/>
#        SecRuleInheritance Off
#    </Directory>
#</IfModule>

When I restart apache, # service httpd restart, and then go onto the site it still says

Forbidden

You don’t have permission to access /phpMyAdmin/ on this server.

Apache/2.2.15 (CentOS) Server at 6gem.pw Port 80

I cant find any fixes, please help.

asked Sep 18, 2016 at 12:18

exper's user avatar

4

I had the same problem and sharing the correct solution here:

To allow connections from All ips in phpMyAdmin directory settings you should change the code like this:

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

   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require all granted   # Add This to skip other requirements
       Require ip 127.0.0.1
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Allow,Deny  # change order to first apply allows, then deny
     Allow from All    # change this from deny to allow from all
     Allow from 127.0.0.1
     Allow from ::1
     Deny from 47.23.165.43  # Bad IPs which should be blocked
   </IfModule>
</Directory>

but if you want to be able to deny some ips and accpet all other ips for apache 2.4 change # Apache 2.4 <RequireAny> part as this:

 # Apache 2.4
 <RequireAll> # change requirement to check all parameters
   Require all granted          # Add This to allow all requests
   Require not ip 47.23.165.43  # Bad IPs which should be blocked
   Require not ip 43.80         # Bad IPs which should be blocked
   Require not ip other.bad.ips # Bad IPs which should be blocked
 </RequireAll>

answered Jan 31, 2020 at 18:28

Mojtaba Rezaeian's user avatar

Mojtaba RezaeianMojtaba Rezaeian

8,1188 gold badges28 silver badges54 bronze badges

On my server it was security2_module blocking requests after a sql query was posted.

Setting SecRuleEngine Off for the phpmyadmin folder did the trick for me:

<Directory /usr/share/phpMyAdmin/>
    ...

    <IfModule security2_module>
        SecRuleEngine Off
    </IfModule>
    ...
</Directory>

answered Apr 20, 2020 at 20:18

sax's user avatar

1

Edit your phpMyAdmin configuration file:

vim /etc/httpd/conf.d/phpMyAdmin.conf

Then change all «Deny from All» to «Deny from None» and «Allow form None» to «Allow from All».
That should work :)

answered Jun 28, 2017 at 8:20

Jerry's user avatar

JerryJerry

114 bronze badges

This works for me under CentOS 7.

Assuming you have installed phpmyadmin with yum.

First, check in the localhost by loading http://localhost/phpmyadmin in your browser.
If you get the forbidden message, probably is because php is not installed.
In my case, I remove phpmyadmin installation, install php and install phpmyadmin again:
(as root)
yum remove phpmyadmin
yum install php
yum install phpmyadmin
service httpd restart

These steps fixed the problem in the local machine.

Now, edit /etc/httpd/conf.d/phpMyAdmin.conf if you want to add permissions for another machine (i.e. 192.168.1.10). By default, it allows access only for localhost.

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

Restart httpd service:
service httpd restart

answered Mar 23, 2018 at 18:01

edison's user avatar

edisonedison

1212 silver badges6 bronze badges

Did you perform the following as well? This helped me:

    mkdir /usr/share/phpMyAdmin/tmp

    chmod 777 /usr/share/phpMyAdmin/tmp

    chown -R apache:apache /usr/share/phpMyAdmin
    
    yum install -y policycoreutils-python-utils
    
    semanage fcontext -a -t httpd_sys_rw_content_t '/usr/share/phpMyAdmin/'
    
    semanage fcontext -a -t httpd_sys_rw_content_t '/usr/share/phpMyAdmin/tmp(/.*)?'
    
    restorecon -Rv '/usr/share/phpMyAdmin/'

Then restart apache service: systemctl restart httpd

answered Dec 11, 2020 at 3:16

Mike Croteau's user avatar

Mike CroteauMike Croteau

1,0622 gold badges16 silver badges42 bronze badges

Require local

to

Require all granted

then restart the xampp services.

Dharman's user avatar

Dharman

30.4k22 gold badges84 silver badges132 bronze badges

answered Jan 2, 2021 at 12:47

Sourav Purkait's user avatar

I’m running Ubuntu 14.04 LTS server and I’m trying to get phpMyAdmin to work. Whenever I open up 192.168.0.xxx/phpmyadmin it gives me a 403 error. I also have WordPress installed and I can access that without any issues.

I’ve tried:

  • Setting the ownership to Apache
  • Restarting my computer/server
  • Used a different computer
  • Uninstalled/reinstalled it (including uninstallinstall, purgeinstall, and install --reinstall)
  • Reading a lot of tutorials/AU questions/posts/blogs of how to fix this, yet none of them have shown me a valid solution.

One odd thing that I find when looking at the «homepage» of the site (i.e. no /foobar on the end), it shows a file explorer. However, it doesn’t show phpMyAdmin. Also, it was working a few days ago, and I don’t remember changing anything. The only thing that looks odd about this is there’s usually something with /serv IIRC, but that may have just been the way I had it on another server…

Note: there’s no .htaccess file in the /usr/share/phpmyadmin folder. I’ve seen some articles hinting that there should be one, but I can’t find a definite answer.

/etc/phpmyadmin/apache.conf file:

# phpMyAdmin default Apache configuration
Alias /phpmyadmin /usr/share/phpmyadmin
<Directory /usr/share/phpmyadmin>
    Options FollowSymLinks
    DirectoryIndex index.php
    order deny,allow
    #deny from all
    allow from all
    <IfModule mod_php5.c>
            AddType application/x-httpd-php .php

            php_flag magic_quotes_gpc Off
            php_flag track_vars On
            php_flag register_globals Off
            php_value include_path .
    </IfModule>

</Directory>
# Authorize for setup
<Directory /usr/share/phpmyadmin/setup>
 <IfModule mod_authn_file.c>
 AuthType Basic
 AuthName "phpMyAdmin Setup"
 AuthUserFile /etc/phpmyadmin/htpasswd.setup
 </IfModule>
 Require valid-user
</Directory>
#Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/libraries>
   Order Deny,Allow
   Deny from All
</Directory>
<Directory /usr/share/phpmyadmin/setup/lib>
  Order Deny,Allow
  Deny from All
</Directory>

Apache config file:

# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
Mutex file:${APACHE_LOCK_DIR} default

# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

KeepAlive On

# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

# HostnameLookups
HostnameLookups Off

# ErrorLog: The location of the error log file.
ErrorLog ${APACHE_LOG_DIR}/error.log

# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# Include list of ports to listen on
Include ports.conf

# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all denied
</Directory>

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>


# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^.ht">
        Require all denied
</FilesMatch>

# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
LogFormat "%v:%p %h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"" vhost_combined
LogFormat "%h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"" combined
LogFormat "%h %l %u %t "%r" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Include /etc/phpmyadmin/apache.conf

(I do apologize for dumping a large chunk of text in here, but I’ve been working on this for about three hours and I can’t figure out how to fix this. I’d be happy to provide any more files if needed, just leave a comment.)

What is causing this and how can I fix it?

Since a few weeks I am getting errors within phpmyadmin, when I try to switch to the next result page, or if I use the search feature.

I get an red window within phpmyadmin telling me, that an error 403 happened. Errortext: Forbidden (rejected) — It seems that the connection to server has been lost. Please check your network connectivity and server status.

I have no mod_security module installed. It happens when I log in into phpmyadmin as DB-User and also happens as «root»-User.

Could not find any informations in mysql.err or in apache error.log.

What could cause this problem? I am using Apache/2.4.7, libmysql 5.5.58, PHP 5.5.9 on Ubuntu.

i mannually installed phpMyAdmin according to this doc:quick install.but i keep getting the 403 error, i can successfully get into other folders in the root dir, how can i sovle this?

here is my config.inc.php:

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * phpMyAdmin sample configuration, you can use it as base for
 * manual configuration. For easier setup you can use setup/
 *
 * All directives are explained in Documentation.html and on phpMyAdmin
 * wiki <http://wiki.phpmyadmin.net>.
 *
 * @package phpMyAdmin
 */

/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
$cfg['blowfish_secret'] = 'jfdsajfdksa'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

/*
 * Servers configuration
 */
$i = 0;

/*
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

/*
 * phpMyAdmin configuration storage settings.
 */

/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';

/* Storage database and tables */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma_relation';
// $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
// $cfg['Servers'][$i]['history'] = 'pma_history';
// $cfg['Servers'][$i]['tracking'] = 'pma_tracking';
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
// $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
/* Contrib / Swekey authentication */
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';

/*
 * End of servers configuration
 */

/*
 * Directories for saving/loading files from server
 */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

/**
 * Defines whether a user should be displayed a "show all (records)"
 * button in browse mode or not.
 * default = false
 */
//$cfg['ShowAll'] = true;

/**
 * Number of rows displayed when browsing a result set. If the result
 * set contains more rows, "Previous" and "Next".
 * default = 30
 */
//$cfg['MaxRows'] = 50;

/**
 * Use graphically less intense menu tabs
 * default = false
 */
//$cfg['LightTabs'] = true;

/**
 * disallow editing of binary fields
 * valid values are:
 *   false  allow editing
 *   'blob' allow editing except for BLOB fields
 *   'all'  disallow editing
 * default = blob
 */
//$cfg['ProtectBinary'] = 'false';

/**
 * Default language to use, if not browser-defined or user-defined
 * (you find all languages in the locale folder)
 * uncomment the desired line:
 * default = 'en'
 */
//$cfg['DefaultLang'] = 'en';
//$cfg['DefaultLang'] = 'de';

/**
 * default display direction (horizontal|vertical|horizontalflipped)
 */
//$cfg['DefaultDisplay'] = 'vertical';


/**
 * How many columns should be used for table display of a database?
 * (a value larger than 1 results in some information being hidden)
 * default = 1
 */
//$cfg['PropertiesNumColumns'] = 2;

/**
 * Set to true if you want DB-based query history.If false, this utilizes
 * JS-routines to display query history (lost by window close)
 *
 * This requires configuration storage enabled, see above.
 * default = false
 */
//$cfg['QueryHistoryDB'] = true;

/**
 * When using DB-based query history, how many entries should be kept?
 *
 * default = 25
 */
//$cfg['QueryHistoryMax'] = 100;

/*
 * You can find more configuration options in Documentation.html
 * or here: http://wiki.phpmyadmin.net/pma/Config
 */
?>

phpMyAdmin - Error in processing request

Last updated on July 9th, 2022

Recently I’ve been seeing this error pop up in phpMyAdmin on a few of my sites. After reviewing server error logs, it seems Wordfence was the culprit. If you’re not running Wordfence, check that you don’t have a firewall somewhere intercepting POST data to phpMyAdmin, e.g. mod_security, Cloudflare, etc.

How to Fix phpMyAdmin 403 Error “Error in processing request”

The error is as follows:

Error in processing request
Error code: 403
Error text: Forbidden (rejected)
It seems that the connection to server has been lost.
Please check your network connectivity and server status.

Go to Wordfence > Tools, and check the firewall activity log.

Here we can see POST data being blocked for phpMyAdmin.

Click “Add Param to Firewall Allowlist”

 "Add Param to Firewall Allowlist"

To ensure that the firewall rule has been added, go to Wordfence > Firewall > Manage WAF (below “Web Application Firewall”) > Scroll down to Allowlisted URLs.

Here you can see a new rule with these values:

  • URL: /phpmyadmin/index.php
  • Param Type: POST Body
  • Param Name: sql_query

Wordfence
URL: /phpmyadmin/index.php
Param Type: POST Body
Param Name: sql_query

Hope this helps!

Let me know if this helped. Follow me on Twitter, Facebook and YouTube, or 🍊 buy me a smoothie.

p.s. I increased my AdSense revenue by 200% using AI 🤖. Read my Ezoic review to find out how.

Понравилась статья? Поделить с друзьями:
  • Ошибка 403 nginx как исправить
  • Ошибка 403 majordomo
  • Ошибка 403 http status
  • Ошибка 403 html шаблон
  • Ошибка 403 google поиск