How to setup phpmyadmin on a Laravel Homestead box

2019-01-29 16:58发布

I installed it by running sudo apt-get install phpymyadmin and then running

sudo ln -s /usr/share/phpmyadmin/ /usr/share/nginx/html and sudo service nginx restart

but it's not working.

note: I didn't select any of apache2 or lighttpd options when installing.

14条回答
等我变得足够好
2楼-- · 2019-01-29 17:16

adminer index file is located in adminer/adminer so try :

serve adminer.app /home/vagrant/Code/adminer/adminer
查看更多
何必那么认真
3楼-- · 2019-01-29 17:18

Finally it worked for me, few things I had to fix:

Homestead.yaml file:

- map: phpmyadmin.test
  to: /home/vagrant/code/phpmyadmin/

I had to delete /public from the end. I installed phpmyadmin (after vagrant ssh command from Homestead directory) into the 'code' folder where the other projects are. When 'code' is with lowercase, it has to be everywhere so (or other way around): folder name, yaml file or even after installation performing these commands:

sudo ln -s /usr/share/phpmyadmin/ /home/vagrant/code/phpmyadmin
cd ~/code && serve phpmyadmin.test /home/vagrant/code/phpmyadmin
查看更多
萌系小妹纸
4楼-- · 2019-01-29 17:19

This is the most simple solution. No mapping and all needed.

  1. Download latest phpmyadmin version from here https://www.phpmyadmin.net/downloads

  2. Make a folder named phpmyadmin inside your main root/public folder and unzip phpmyadmin here.

  3. Run yourwebsite.com/phpmyadmin

查看更多
在下西门庆
5楼-- · 2019-01-29 17:21

A simplified version of Jyeon's Answer. You don't need to share the ~/Code folder in the Homestead.yaml file:

folders:
    - map: /Users/{yourName}/Code/phpMyAdmin
      to: /home/vagrant/Code/phpMyAdmin

Just download the latest version of PhpMyAdmin from PhpMyAdmin and put the unzipped file in the ~/Code/phpMyAdmin folder and just follow the 2 step here:

Step 1: Open up homestead.yaml file and add these lines

sites: - map: phpmyadmin.app to: /home/vagrant/Code/phpMyAdmin

Step 3: Open up your hosts file and add this line:

192.168.10.10 phpmyadmin.app

Now run the vagrant reload --provision command and you're good to go.

Open up the phpmyadmin.app address in your browser and you'll see the phpmyadmin interface.

查看更多
Juvenile、少年°
6楼-- · 2019-01-29 17:23

The answer from Nikos Gr worked for me; however I needed to amend steps 2 and 3 as my host system has issues creating the symlink.

I changed:

sudo ln -s /usr/share/phpmyadmin/ /home/vagrant/Code/phpmyadmin
cd ~/Code && serve phpmyadmin.app /home/vagrant/Code/phpmyadmin

To:

cd ~/Code && serve phpmyadmin.app /usr/share/phpmyadmin/

(Couldn't comment on the original solution as my rep isn't high enough!)

查看更多
冷血范
7楼-- · 2019-01-29 17:24

For another alternative that I found super simple and that worked right out of the box I set up a new Nginx site from inside the Homestead box using the serve.sh script:

serve adminer.app /home/vagrant/Code/adminer/

And then in there I dropped the one page successor to phpmyadmin, Adminer. I also renamed it to "index.php" to make it just work. Then after adding the adminer.app entry to my hosts file I was good to go.

Had not used a web based MySQL interface in years since I just didn't like maintaining phpMyAdmin but this one is sweet. One file (plus an optional CSS file if you want a nicer theme) and that is all. Easy to maintain and update.

查看更多
登录 后发表回答