Can't access phpmyadmin (apache ok, php ok)

26,886

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
Share:
26,886

Related videos on Youtube

abalter
Author by

abalter

Updated on September 18, 2022

Comments

  • abalter
    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(); ?>). 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
    
    • Admin
      Admin over 6 years
      where did you drop the phpmyadmin folder, is it in /var/www/html?
    • Admin
      Admin over 6 years
      Well, I didn't "drop" the folder anywhere. I ran sudo aptitude install phpmyadmin.
    • Admin
      Admin over 6 years
      ok run locate phpmyadmin let's see where it is but I feel it's in the /opt folder mine is manually installed!
    • Admin
      Admin over 6 years
      'locate phpmyadmin` returns nothing. But there are files in /etc/phpmyadmin.
    • Admin
      Admin over 6 years
      Added all directories with phpmyadmin stuff to original post.
    • Admin
      Admin over 6 years
      Possible duplicate of Where is my phpMyAdmin installation?
    • Admin
      Admin over 6 years
      How you have installed phpmyadmin?
    • Admin
      Admin over 6 years
      @pa4080 as above: `sudo aptitude install phpmyadmin'
    • Admin
      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
      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
      Admin over 6 years
      Make a symbolic link from /usr/share/phpmyadmin/ to /var/www/html/phpmyadmin
    • Admin
      Admin over 6 years
      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, I think it will give you an idea.
    • Admin
      Admin over 6 years
      @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.
    • Admin
      Admin over 6 years
      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.
    • Admin
      Admin over 6 years
      @abalter, I've done that.
  • Bradford Benn
    Bradford Benn over 6 years
    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.
  • pa4080
    pa4080 over 6 years
    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
    pa4080 over 6 years
    @BradfordBenn what is the error message when you try to browse localhost/phpmyadmin ?
  • Bradford Benn
    Bradford Benn over 6 years
    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