19

I'm trying to install phpmyadmin on my new server, following this guide

apt-get install phpmyadmin
nano /etc/apache2/apache2.conf

then added phpmyadmin to apache configuration:

Include /etc/phpmyadmin/apache.conf

and restarted apache:

service apache2 restart

All this by SSH.

But now when i try to access: x.x.x.x/phpmyadmin all that i get is that my browser downloads a file... Can someone help with this?

miken32
  • 42,008
  • 16
  • 111
  • 154
Cereal Killer
  • 3,387
  • 10
  • 48
  • 80
  • 1
    sounds like you don't have PHP installed / configured correctly. as per the guide you referenced "Before working with phpMyAdmin you need to have LAMP installed on your server. If you don't have the Linux, Apache, MySQL, PHP stack on your server, you can find the tutorial for setting it up here..." – Joe T Aug 30 '13 at 22:55
  • well, PHP is working on my website, located in home/xxx/public_html/site.com maybe i have to configure something else to have it working also with phpmyadmin? – Cereal Killer Aug 30 '13 at 22:57
  • 1
    is the file downloaded the phpmyadmin index page? check out http://stackoverflow.com/questions/2447021/index-php-is-not-opening-and-running-as-download-the-file – Joe T Aug 30 '13 at 23:03
  • Possible duplicate of [PHP code is not being executed, instead code shows on the page](http://stackoverflow.com/questions/5121495/php-code-is-not-being-executed-instead-code-shows-on-the-page) – miken32 Aug 23 '16 at 20:21

2 Answers2

39

If you are sure that you do have lamp-stack just open up your terminal and type edit

/etc/apache2/apache2.conf

and paste the following at the end of file

Include /etc/phpmyadmin/apache.conf

Save the file and restart using sudo service apache2 restart

You can also visit https://help.ubuntu.com/community/phpMyAdmin for more details.

Mani
  • 564
  • 5
  • 13
8

You can do two things I guess, as I've experienced both of them : 1. you need to add

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

2. Add this line at last or somewhere in code:

Include /etc/phpmyadmin/apache.conf

3. restart :

sudo service apache2 restart

but this didn't worked for me(apache2 failed to restart), as it worked for many. Otherwise you can eve try:

ln -s /etc/phpmyadmin/apache.conf /etc/apache2/sites-enabled/001-phpmyadmin

Or

sudo dpkg-reconfigure phpmyadmin

and under webserver select: apache.

Yash Jain
  • 195
  • 4
  • 9
  • The option to reconfigure via `sudo dpkg-reconfigure phpmyadmin` really helps to keep reattempting to get it right the "auto way" until it works. Thank you. – Andre Bulatov Mar 31 '18 at 05:55