Phpmyadmin returns 403 error

I’m currently trying to make a database for my pet project.

I’ve done everything according to this guide [ https://forum.manjaro.org/t/howto-install-apache-mariadb-mysql-php-lamp/13000 ] ,
but at when i try to go to http://localhost/phpmyadmin i just get 403 error

The fun fact is that apache seems to work perfectly

$sudo systemctl status httpd
> httpd.service - Apache Web Server
     Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; preset: disabled)
     Active: active (running) since Sun 2022-11-06 17:05:35 MSK; 9min ago
   Main PID: 5291 (httpd)
      Tasks: 7 (limit: 8242)
     Memory: 8.9M
        CPU: 134ms
     CGroup: /system.slice/httpd.service
             ├─5291 /usr/bin/httpd -k start -DFOREGROUND
             ├─5293 /usr/bin/httpd -k start -DFOREGROUND
             ├─5294 /usr/bin/httpd -k start -DFOREGROUND
             ├─5295 /usr/bin/httpd -k start -DFOREGROUND
             ├─5296 /usr/bin/httpd -k start -DFOREGROUND
             ├─5297 /usr/bin/httpd -k start -DFOREGROUND
             └─5329 /usr/bin/httpd -k start -DFOREGROUND

Nov 06 17:05:35 qwerty-inspiron5555 systemd[1]: Started Apache Web Server.
Nov 06 17:05:35 qwerty-inspiron5555 httpd[5291]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'Server>

same with mysql

$mysql
> Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.9.3-MariaDB Arch Linux

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

What should i do to make phpmyadmin work?

403 Forbidden
The request contained valid data and was understood by the server, but the server is refusing action. This may be due to the user not having the necessary permissions for a resource or needing an account of some sort, or attempting a prohibited action (e.g. creating a duplicate record where only one is allowed). This code is also typically used if the request provided authentication by answering the WWW-Authenticate header field challenge, but the server did not accept that authentication. The request should not be repeated.

So you will have check your configuration

But how? I dont understand anything in apache config and just did everything as in instruction

Hi @gamer_girl_2007_nah,

Are you sure yyou have enabled the configuration?

Either with

a2enconf

or

a2ensite

And/or (I can’t remember right now.)

systemctl restart httpd

Provide the content of your configuration for phpmyadmin.

Im not sure what you mean, but i have added

Include conf/extra/phpmyadmin.conf

line to /etc/httpd/conf/httpd.conf

.

/etc/httpd/conf/extra/phpmyadmin.conf content:

Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"
<Directory "/usr/share/webapps/phpMyAdmin">
DirectoryIndex index.php
AllowOverride All
Options FollowSymlinks
Require all granted
</Directory>

It’s been many, many, many moons since I’ve setup phpmyadmin last, so I might miss something new. However, this :point_down:

…doesn’t look right to me. Please provide the output of:

sudo find / -type f -name 'phpmyadmin.conf'

Edit:

Quickly scanning through the instructions, shows me I’m correct:

You seem to have either skipped something, or chopped and changed it so much that it is not obviously where the problem lies.

I recommend starting from scratch and following the instructions to the letter. Not customizing anything to start with, just getting it to work first. And then, and only then changing/customizing as required.

The output:

find: ‘/run/user/1000/doc’: Permission denied
find: ‘/run/user/1000/gvfs’: Permission denied

Kinda strange, as i have made sudo nano /etc/httpd/conf/extra/phpmyadmin.conf

/etc/httpd/conf/extra/phpmyadmin.conf content:

Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"
<Directory "/usr/share/webapps/phpMyAdmin">
DirectoryIndex index.php
AllowOverride All
Options FollowSymlinks
Require all granted
</Directory>

Not really. Because, this path :point_down:

Isn’t the same as this path :point_down:

Hence my recommendation.

Just checked the guide, the paths are correct
I think its cuz conf/extra/phpmyadmin.conf is used from /etc/httpd/conf/httpd.conf (i mean etc/httpd folder)

just like here

Include conf/extra/php_module.conf
Include conf/extra/phpmyadmin.conf

There’s a big difference between etc and /etc.

Edit:

I’m still going with a mis-configuration somewhere. These paths are relative. While, in my opinion they should be absolute.

Thanks, /etc/httpd =)
But… the problem is still unsolved

I tried to change them to absolute, but it still doesnt work=(

It’s difficult to deduct what your issue is specifically.

The only cause I can think of is permission related - hence the 403 Forbidden and this leads me to think it is related ot the mariadb configuraiton.

For the exercise and verification of the guide you mentioned I tested this running a test environment based on xfce - and result is excatly as advertised.

Did you test the services using a browser?

  1. the index.html
    Summary

  2. the test.php
    Summary

  3. the myphpadmin
    Summary

They are normal because it is local to the httpd (/etc/httpd) - no one else reads the config.

Yes, all works fine, except phpmyadmin…
And how to fix or at least check db configuration? Cuz from console mysql forks as it should

When you ran the secure installation script did you choose socks connection and did you provide a password for root?

As I validated the guide to be correct to the letter, there must have been some deviation on your part. Retrace your steps to locate it.

1 Like

Thanks guys, i finally make it work! :slightly_smiling_face:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.