Can't access phpmyadmin (apache ok, php ok)
Within the default Ubuntu's installation (apt install phpmyadmin
) PhpMyAdmin is included (and enabled) into the Apache's configuration through this additional configuration file:
/etc/apache2/conf-enabled/phpmyadmin.conf
This file is a symbolic link to the file /etc/apache2/conf-available/phpmyadmin.conf
and when we type a2enconf
or a2disconf
we 'enable' or 'disable' this symbolic link.
On its side, the file /etc/apache2/conf-enabled/phpmyadmin.conf
is a symbolic link to the file /etc/phpmyadmin/apache.conf
.
According to the discussion below the question, during the installation process something goes wrong and the last symbolic link isn't created.
The solution, that @abalter provided, is manual creation of this symbolic link:
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
Then enable this configuration file and restart Apache or just reload its configuration:
sudo a2enconf phpmyadmin.conf
sudo systemctl reload apache2.service # within Ubuntu 16.04
sudo service apache2 reload # within Ubuntu 14.04
Related videos on Youtube
abalter
Updated on September 18, 2022Comments
-
abalter over 1 year
When I go to
localhost/phpmyadmin
I get the apache "Not Found" error (404). However, I can load html pages, and run php pages (such as<?php phpinfo(); ?>
). Andphpmyadmin
is installed.balter@homedevbox:~$ aptitude search phpmyadmin i phpmyadmin - MySQL web administration tool
I also installed the standard ubuntu LAMP stack and set passwords for mysql and all that.
What could be the problem?
EDIT: Here is where my
phpmyadmin
files are.balter@homedevbox:/var$ cd / balter@homedevbox:/$ sudo find . -type d -name phpmyadmin ./var/lib/mysql/phpmyadmin ./var/lib/phpmyadmin ./etc/phpmyadmin ./usr/share/phpmyadmin ./usr/share/dbconfig-common/scripts/phpmyadmin ./usr/share/dbconfig-common/data/phpmyadmin ./usr/share/doc/phpmyadmin
-
Admin over 6 yearswhere did you drop the
phpmyadmin
folder, is it in/var/www/html
? -
Admin over 6 yearsWell, I didn't "drop" the folder anywhere. I ran
sudo aptitude install phpmyadmin
. -
Admin over 6 yearsok run
locate phpmyadmin
let's see where it is but I feel it's in the/opt
folder mine is manually installed! -
Admin over 6 years'locate phpmyadmin` returns nothing. But there are files in
/etc/phpmyadmin
. -
Admin over 6 yearsAdded all directories with phpmyadmin stuff to original post.
-
Admin over 6 yearsPossible duplicate of Where is my phpMyAdmin installation?
-
Admin over 6 yearsHow you have installed phpmyadmin?
-
Admin over 6 years@pa4080 as above: `sudo aptitude install phpmyadmin'
-
Admin over 6 years@George -- it's not about "where" it is installed. It's why after doing a routine install I can't access it.
-
Admin over 6 years@abalter did you make that symbolic link to where it is? Apache can't see it so you need to tell apache where it is hence the duplicate link I gave
-
Admin over 6 yearsMake a symbolic link from
/usr/share/phpmyadmin/
to/var/www/html/phpmyadmin
-
Admin over 6 yearsBy the default installation PhpMuAdmin is involved into the Apache's configuration through the configuration file
/etc/apache2/conf-available/phpmyadmin.conf
, which is a symlink to/etc/phpmyadmin/apache.conf
. So, just in case, you can try to enable this configuration file by the commandsudo a2enconf phpmyadmin
, then restart Apache:sudo systemctl restart apache2.service
. Please check this answer, I think it will give you an idea. -
Admin over 6 years@pa4080 -- when I run
sudo a2enconf phpmyadmin
I getERROR: Conf phpmyadmin does not exist!
. So something clearly is going wrong with the installation. I uninstalled and then reinstalled (with aptitude). So something is not working. -
Admin over 6 yearsSo, I created the symlink manually and was able to enable the conf file. I can now reach phpmyadmin! @pa4080 if you want to create an answer, I can accept it.
-
Admin over 6 years@abalter, I've done that.
-
-
Bradford Benn over 6 yearsUnfortunately this did not fix the issue for me. I have checked the symbolic links using "find . -type l -ls" and they appear active. Is there something else I can check? I did also verify that I have "Include /etc/phpmyadmin/apache.conf" included in my apache2.conf file. Before I post a new similar question, I figured I would double check for any additional insight. Thanks.
-
pa4080 over 6 yearsHi, @BradfordBenn, in
apache2.conf
have a directiveIncludeOptional conf-enabled/*.conf
, which includes all configuration files into Apache's configuration. So we don't need do putInclude /etc/phpmyadmin/apache.conf
withinapache2.conf
if the above symlinks exists. Last week I sow a wrong configuration where the directiveInclude /etc/phpmyadmin/apache.conf
was included into the same file/etc/phpmyadmin/apache.conf
and this was the problem. -
pa4080 over 6 years@BradfordBenn what is the error message when you try to browse
localhost/phpmyadmin
? -
Bradford Benn over 6 yearsit is the simple file 404 file not found. I just went into the apache2.conf and removed that line and rebooted. The exact error is: Not Found The requested URL /myphpadmin was not found on this server. Apache/2.4.18 (Ubuntu) Server at 172.22.106.247 Port 80 as it is truly a server install there is no local browser I am familiar with to use localhost