Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
375 views
in Technique[技术] by (71.8m points)

php - Have trouble installing phpmyadmin on PHP7 Apache/2.4.7 (Ubuntu)

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

after this, I got 403 forbidden error when I tried to access phpmyadmin. then I tried to reinstall phpmyadmin with

apt-get install phpmyadmin

but it still looks for php5 dependencies which arent there anymore:

Image Description

what can I do to solve this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Install it via wget and create an alias in Apache. Keep track:

Change to directory /usr/share:

cd /usr/share

Change to root user:

 sudo su

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

Rename the folder:

mv phpMyAdmin-4.5.4.1-all-languages phpmyadmin

Change permissions:

chmod -R 0755 phpmyadmin

Configure apache so that it can find it correctly:

vim /etc/apache2/sites-available/000-default.conf

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>

Restart Apache:

service apache2 restart

And you are ready to go!

Just took a screenshot from my current installation for you to validate it works. enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...