60

Setting up a development environment with Ubuntu 14.04 running in VirtualBox, following this guide: http://klau.si/dev

After installing phpmyadmin, it seems I should be able to access it at http://localhost/phpmyadmin but apache returns a Not Found error. Did this guide leave out a configuration step somewhere? I have already tried restarting the apache service.

There is no phpmyadmin.conf file in apache2/sites-enabled or apache2/sites-available, is this required?

If so, where can I find these files?

using 127.0.0.1 instead of localhost returns the same error. The default apache page at http://localhost works just fine.

the console in the browser shows nothing of value, simply Not Found.

I have also tried rerunning the install script with dpkg-reconfigure -plow phpmyadmin

Anonymous Man
  • 2,776
  • 5
  • 19
  • 38

19 Answers19

146

This issue was resolved thanks to this guide: https://help.ubuntu.com/community/ApacheMySQLPHP#Troubleshooting_Phpmyadmin_.26_mysql-workbench by adding

Include /etc/phpmyadmin/apache.conf

...to the /etc/apache2/apache2.conf file and restarting the service.

Anonymous Man
  • 2,776
  • 5
  • 19
  • 38
83

Try this

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin.conf
sudo systemctl restart apache2
Rashmi Jain
  • 1,385
  • 12
  • 18
58
sudo dpkg-reconfigure -plow phpmyadmin 

Select No when asked to reconfigure the database. Then when asked to choose apache2, make sure to hit space while [ ] apache2 is highlighted. An asterisk should appear between the brackets. Then hit Enter. Phpmyadmin should reconfigure and now http://localhost/phpmyadmin should work. for further detail https://www.howtoforge.com/installing-apache2-with-php5-and-mysql-support-on-ubuntu-13.04-lamp

Bikram Shrestha
  • 2,010
  • 24
  • 22
  • This one is valid answer...also use tab to highlight an option like "ok" or "cancel" – BharathRao May 21 '18 at 18:32
  • Nope, keeping up with SO's apparent 100% track record of providing non-working answers wherever my Ubuntu install ins concerned, this leaves me with the same "Page not found" error it was supposed to solve. – John Smith Jun 08 '20 at 00:53
  • 1
    Follow the steps as expained without leaving any point @JohnSmith – Bikram Shrestha Jun 14 '20 at 15:29
43

The easiest way to do in ubuntu (I tested in ubuntu-20.04):

Step 1. Open the file:

sudo nano /etc/apache2/apache2.conf

Step 2: Add the following line at the end of file:

Include /etc/phpmyadmin/apache.conf

Step 3: Restart apache2:

sudo systemctl restart apache2.service
Dharman
  • 30,962
  • 25
  • 85
  • 135
protanvir993
  • 2,759
  • 1
  • 20
  • 17
14

Create a link in /var/www like this:

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

Note: since 14.04 you may want to use /var/www/html/ instead of /var/www/

If that's not working for you, you need to include PHPMyAdmin inside apache configuration.

Open apache.conf using your favorite editor, mine is nano :)

sudo nano /etc/apache2/apache2.conf

Then add the following line:

Include /etc/phpmyadmin/apache.conf

For Ubuntu 15.04 and 16.04

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin.conf
sudo service apache2 reload
francescalus
  • 30,576
  • 16
  • 61
  • 96
Nurul Furqon
  • 149
  • 1
  • 6
  • what is username password default to login in phpmyadmin ? – Gauravbhai Daxini Aug 14 '18 at 05:28
  • NOPE! God, I'm just loving spending days and days on SO trying things to try and get my stock Ubuntu installation running, of which literally ZERO ever work. How does anyone ever use Ubuntu? Does it ever work at all? Literally NOBODY seems to know how to fix ANY problems with it at all. – John Smith Jun 08 '20 at 00:59
  • 1
    @JohnSmith You ever find a solution to this? None of these worked for me either. – J82 Dec 27 '21 at 12:26
7

Finally I got the solution

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

More about https://askubuntu.com/questions/55280/phpmyadmin-is-not-working-after-i-installed-it

Kaushik shrimali
  • 1,178
  • 8
  • 15
5

Create a link in /var/www/html like this to fix the error:

sudo ln -s /usr/share/phpmyadmin /var/www/html
The Matt
  • 1,423
  • 1
  • 12
  • 22
Javed Ali
  • 69
  • 1
  • 6
  • False, just like, apparently, every single other response to every single Ubuntu issue on SO... leaves me with the same Page Not Found error that every other "solution" does. – John Smith Jun 08 '20 at 01:01
2

For anyone still running into issues with this- check that you're actually using apache! I knocked my head against this for 20 minutes or so before I remembered...I use NginX on this server...=). @john-smith, this one's for you buddy.

To get it working on nginx, all you should have to do is create a sim link and restart php:

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

Note that for you, it may be /var/www/ and not /var/www/html, depending on your dir structure.

qozle
  • 140
  • 10
1
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

Run above commands issue will be resolved.

Sundar
  • 253
  • 2
  • 6
0

Run the following command in terminal:

sudo ln -s /usr/share/phpmyadmin /var/www/html/
Vahid Boreiri
  • 3,418
  • 1
  • 19
  • 34
praveen
  • 9
  • 1
0

It seems like sometime during the second half of 2018 many php packages such as php-mysql and phpmyadmin were removed or changed. I faced that same problem too. So you'll have to download it from another source or find out the new packages

j0k3r
  • 1
0

You will need to configure your apache2.conf to make phpMyAdmin works.

sudo nano /etc/apache2/apache2.conf

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

Include /etc/phpmyadmin/apache.conf

Then restart apache

sudo service apache2 restart

0

I had the same issue where these fixes didn't work.

I'm on Ubuntu 20.04 using hestiaCP with Nginx.

Today after adding

Include /etc/phpmyadmin/apache.conf

into both Apache and Nginx, Nginx failed to restart. It was having an issue with "proxy_buffers" value.

Yesterday I had to modify the Nginx config to add and increase these values so Magento 2.4 would run. Today I altered "proxy_buffers" again

proxy_buffers            3 64k;
proxy_buffer_size        128k;
proxy_busy_buffers_size  128k;

After the second alteration and the removal of "Include /etc/phpmyadmin/apache.conf" from both Apache and Nginx, Magento 2.4 and PHPMyAdmin are working as expected.

0

I didn't try Rashmi Jain's symlink answer. It seems like it would work. But if it doesn't work for you, perhaps try this.

I just created the file `/etc/apache2/conf-available/phpmyadmin.conf' and added this line to it:

Include /etc/phpmyadmin/apache.conf

(rather than putting it into /etc/apache2/apache2.conf as in Anonymous Man's answer)

Then:

sudo a2enconf phpmyadmin
sudo systemctl reload apache2
Buttle Butkus
  • 9,206
  • 13
  • 79
  • 120
0

I had the same problem after installing mysql, apache2, php and finally phpmyadmin after each other. In my case it was solved by restarting apache2 (no need to update any configuration file):

sudo systemctl restart apache2
Thomas L
  • 1
  • 1
0

@John smith, I was facing the same issue of not being able to access phpmyadmin for 3 days, I found the solution. -- Get xampp, check this tutorial https://youtu.be/VHfij95yOpo -- Run this command before starting xampp app

sudo /etc/init.d/apache2 stop

sudo service mysql stop

That's it, it worked for me

andy
  • 1
  • 1
0

first go to the location of phpmyadmin via terminal then type this
code php -S localhost:8001

  • Although this is a way to get PHP to serve PHPMyAdmin, it isn't really the answer to the question, since the question is about using it with Apache. It also doesn't really explain what that does. It should also include supporting information. – hsanders Nov 23 '22 at 21:05
-1

First check PhpMyAdmin is install or not. If it is installed then search PhpMyadmin folder. After search cut and paste that folder in location Computer->var->www->html->paste folder. Open browser and type localhost/phpMyAdmin and login using username and password.

currarpickt
  • 2,290
  • 4
  • 24
  • 39
-1

If you are having this problem in 2019, go to your 000-default.conf file, by typing this subl /etc/apache2/sites-enabled/000-default.conf (in your terminal to open the file in sublime editor)

When the file loads, locate "The ServerName directive sets the request scheme" and place this "Include /etc/phpmyadmin/apache.conf" on top .

Then restart your apache with the command...service apache2 restart That will certainly fix the issue. Hope it helps!

Laxman
  • 2,643
  • 2
  • 25
  • 32