9

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(); ?>). And phpmyadmin 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
abalter
  • 347
  • 1
  • 4
  • 16
  • where did you drop the `phpmyadmin` folder, is it in `/var/www/html`? – George Udosen Aug 08 '17 at 06:18
  • Well, I didn't "drop" the folder anywhere. I ran `sudo aptitude install phpmyadmin`. – abalter Aug 08 '17 at 06:28
  • 1
    ok run `locate phpmyadmin` let's see where it is but I feel it's in the `/opt` folder mine is manually installed! – George Udosen Aug 08 '17 at 06:33
  • 'locate phpmyadmin` returns nothing. But there are files in `/etc/phpmyadmin`. – abalter Aug 08 '17 at 07:22
  • Added all directories with phpmyadmin stuff to original post. – abalter Aug 08 '17 at 07:26
  • Possible duplicate of [Where is my phpMyAdmin installation?](https://askubuntu.com/questions/168191/where-is-my-phpmyadmin-installation) – George Udosen Aug 08 '17 at 07:40
  • How you have installed phpmyadmin? – pa4080 Aug 08 '17 at 08:59
  • @pa4080 as above: `sudo aptitude install phpmyadmin' – abalter Aug 08 '17 at 15:42
  • @George -- it's not about "where" it is installed. It's why after doing a routine install I can't access it. – abalter Aug 08 '17 at 15:42
  • @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 – George Udosen Aug 08 '17 at 15:48
  • Make a symbolic link from `/usr/share/phpmyadmin/` to `/var/www/html/phpmyadmin` – George Udosen Aug 08 '17 at 15:52
  • By 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 command `sudo a2enconf phpmyadmin`, then restart Apache: `sudo systemctl restart apache2.service`. Please check [this answer](https://askubuntu.com/a/897133/566421), I think it will give you an idea. – pa4080 Aug 08 '17 at 16:02
  • 1
    @pa4080 -- when I run `sudo a2enconf phpmyadmin` I get `ERROR: 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. – abalter Aug 08 '17 at 18:10
  • 1
    So, 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. – abalter Aug 08 '17 at 18:24
  • @abalter, I've done that. – pa4080 Aug 08 '17 at 20:24

1 Answers1

12

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
pa4080
  • 29,351
  • 10
  • 85
  • 161
  • Unfortunately 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. – Bradford Benn Aug 30 '17 at 05:57
  • Hi, @BradfordBenn, in `apache2.conf` have a directive `IncludeOptional conf-enabled/*.conf`, which includes all configuration files into Apache's configuration. So we don't need do put `Include /etc/phpmyadmin/apache.conf` within `apache2.conf` if the above symlinks exists. Last week I sow a wrong configuration where the directive `Include /etc/phpmyadmin/apache.conf` was included into the same file `/etc/phpmyadmin/apache.conf` and this was the problem. – pa4080 Aug 30 '17 at 06:29
  • @BradfordBenn what is the error message when you try to browse `localhost/phpmyadmin` ? – pa4080 Aug 30 '17 at 06:42
  • it 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 – Bradford Benn Aug 30 '17 at 17:44