Linux 安装后无法访问phpmyadmin

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18542553/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-07 00:43:21  来源:igfitidea点击:

Can't access phpmyadmin after installation

linuxsshphpmyadmin

提问by Cereal Killer

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

我正在尝试按照本指南在我的新服务器上安装 phpmyadmin

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

then added phpmyadmin to apache configuration:

然后将 phpmyadmin 添加到 apache 配置中:

Include /etc/phpmyadmin/apache.conf

and restarted apache:

并重新启动apache:

service apache2 restart

All this by SSH.

所有这一切都由 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?

但是现在当我尝试访问:xxxx/phpmyadmin 时,我得到的只是我的浏览器下载了一个文件...有人可以帮忙吗?

采纳答案by Mani

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

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

您还可以访问https://help.ubuntu.com/community/phpMyAdmin了解更多详情。

回答by Yash Jain

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

我猜你可以做两件事,因为我已经经历过这两件事:1.你需要添加

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

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

2.最后或代码中的某处添加此行:

Include /etc/phpmyadmin/apache.conf

3. restart :

3.重启:

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:

但这对我不起作用(apache2无法重新启动),因为它对许多人有用。否则你可以尝试:

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

Or

或者

sudo dpkg-reconfigure phpmyadmin

and under webserver select: apache.

并在网络服务器下选择:apache。