When I was restarting the apche2, I was getting this message..

sudo service apache2 restart
 * Restarting web server apache2                                                                                                                AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using Set the 'ServerName' directive globally to suppress this message

and when I was typed the localhost/phpmyadmin, it showing the message

-NOT FOUND The requested URL /phpmyadmin was not found on this server. Apache/2.4.7 (Ubuntu) Server at localhost Port 80

Please help me in this.

  • 6
    Hi There!! Can you try sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin & then sudo /etc/init.d/apache2 reload on a terminal and let me know. Sudo requires admin password, therefore; please provide accordingly. :)
    – AzkerM
    Sep 3, 2015 at 7:52
  • 1
    I'm guessing you have phpmyadmin installed. If that's the case, you shouldn't have to symlink /usr/share/phpmyadmin like above mentioned, however you should check that you have /etc/apache2/conf-available/phpmyadmin.conf and that it has been enabled in /etc/apache2/conf-enabled/phpmyadmin.conf. If it is found in conf-available but not in conf-enabled then you will need to enable it using sudo a2enconf phpmyadmin.conf or sudo a2enconf /etc/apache2/conf-available/phpmyadmin.conf.
    – hazrpg
    Sep 3, 2015 at 9:04
  • 1
    If that doesn't work, then try reinstalling phpmyadmin using sudo apt-get install --reinstall phpmyadmin - this will automatically setup phpmyadmin for you.
    – hazrpg
    Sep 3, 2015 at 9:06

4 Answers 4


Have you tried to:

sudo -H gedit /etc/apache2/apache2.conf

Then add the following line to the end of the file:

Include /etc/phpmyadmin/apache.conf

Then restart apache:

/etc/init.d/apache2 restart
  • To improve answer quality, please explain what these instructions are actually doing and why this needs to be done. Thanks May 21, 2018 at 17:09
  • 2
    This saved my life. I nearly shat myself. Jun 9, 2018 at 1:33
  • Works on ubuntu 22.04 LTS.
    – codeonion
    Sep 6, 2022 at 19:36

I believe this is because You haven't configure your phpmyadmin with the apache server well. If you installed the apache server and phpmyadmin using sudo apt-get install (Because you can install them using source code etc.) below procedure may works for you.

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf

sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin

sudo service apache2 restart

now type localhost/phpmyadmin in web browser address bar

if you did everything correctly now you can see the phpmyadmin on the browser.

(Due to your installation method of apache restarting the server or other thing may different. If it is, then you have to do manually what commands meant to do (this description is believing you are very new to apache in linux :) ))


On Ibrahim's answer, I used the nano in the terminal instead of gedit, cause I could not get gedit to work.

Root Terminal Steps

  1. Paste in terminal, this will open in the terminal Nano editor:

    nano /etc/apache2/apache2.conf
  2. Then add the following line to the end of the file:

    Include /etc/phpmyadmin/apache.conf
  3. ctrl-o and ctrl-x to save and exit.

  4. Then paste in terminal: restart apache:

    /etc/init.d/apache2 restart

just went through this myself with a clean install of 20.04 in a VM ... I believe the 404 issue has to do with my creating a /var/www/[someotherdomain] ... all of the instructions with regards to apache, lamp and PHPMyAdmin appear to expect users to be using /var/www/HTML ... based on the instructions in this thread, after I substituted [someotherdomain] for [html] in the ln command, PHPMyAdmin now works from an intranet web request ... Mamp and Xampp kind of make us lazy by doing all this setup automatically ... not sure if someone has already written a dependency thread for PHPMyAdmin but would make it easier for those of us that don't do this every day ... trying to create a test environment for some GitHub PHP and Java stuff and just spent several days to get something set up that is usable ... Xampp has the latest PHP which for some reason isn't backward compatible and it wasn't clear if Xampp could load an older version of PHP ... Mamp is ok in that it has the correct version of PHP but the PHP stuff I downloaded only has instructions related to a Unix platform ... so I started with 16.04 32b and ran into irreconcilable configuration issues ... tried 18.04 64b again with multiple configuration issues ... now finally have a working 20.04 64b with PHP and MySQL DB

What I had to do to get PHPMyAdmin working was:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .