在PHP7 Apache/2.4.7(Ubuntu)上安装phpmyadmin时遇到问题 [英] Have trouble installing phpmyadmin on PHP7 Apache/2.4.7 (Ubuntu)
问题描述
我今天安装了PHP7,
I installed PHP7 today with
sudo add-apt-repository ppa:ondrej/php-7.0
sudo apt-get install php7.0-cli php7.0-common libapache2-mod-php7.0 php7.0 php7.0-mysql php7.0-fpm
此后,尝试访问phpmyadmin时出现403禁止错误. 然后我尝试用重新安装phpmyadmin
after this, I got 403 forbidden error when I tried to access phpmyadmin. then I tried to reinstall phpmyadmin with
apt-get install phpmyadmin
但它仍在查找不再存在的php5依赖项:
but it still looks for php5 dependencies which arent there anymore:
我该怎么办?
推荐答案
通过wget安装并在Apache中创建别名.跟踪:
Install it via wget and create an alias in Apache. Keep track:
更改到目录/usr/share :
cd /usr/share
更改为root用户:
sudo su
下载phpMyAdmin:
Download phpMyAdmin:
wget https://files.phpmyadmin.net/phpMyAdmin/4.5.4.1/phpMyAdmin-4.5.4.1-all-languages.zip
解压缩:(您可以先安装解压缩)
Unzip it: (you may install unzip first)
unzip phpMyAdmin-4.5.4.1-all-languages.zip
重命名文件夹:
mv phpMyAdmin-4.5.4.1-all-languages phpmyadmin
更改权限:
chmod -R 0755 phpmyadmin
配置apache,以便它可以正确找到它:
Configure apache so that it can find it correctly:
vim /etc/apache2/sites-available/000-default.conf
在" DocumentRoot/var/www/html "之后的任意位置插入以下行:
Anywhere after "DocumentRoot /var/www/html" insert these line:
Alias /phpmyadmin "/usr/share/phpmyadmin/"
<Directory "/usr/share/phpmyadmin/">
Order allow,deny
Allow from all
Require all granted
</Directory>
重新启动Apache:
Restart Apache:
service apache2 restart
您就可以出发了!
只需从我当前的安装中截取一张屏幕截图,以供您验证它的工作原理.
Just took a screenshot from my current installation for you to validate it works.
这篇关于在PHP7 Apache/2.4.7(Ubuntu)上安装phpmyadmin时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!