How do I set up phpMyAdmin on a Laravel Homestead box?

前端 未结 14 1395
无人共我
无人共我 2020-12-12 09:48

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

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

14条回答
  •  Happy的楠姐
    2020-12-12 10:16

    As I couldn't comment on the Jyeon solution as my rep isn't high enough, I contribute with this answer; worked for me in Linux (openSUSE Leap) with Vagrant 1.8.1 and laravel/homestead (virtualbox, 0.4.0):

    Step 1:

    Go to phpMyAdmin website, download the latest version and unzip it into your project directory.

    Step 2:

    Add to your Homestead.yaml file the following lines:

    folders:
        - map: ~/Code/phpMyAdmin
          to: /home/vagrant/Code/phpMyAdmin
    
    Sites:
        - map: phpmyadmin.app
          to: /home/vagrant/Code/phpMyAdmin
    

    Step 3:

    Add to your hosts file the following line:

    192.168.10.10   phpmyadmin.app
    

    Step 4:

    After start your vagrant environment and connects to machine via SSH, set your virtual host to work with phpMyAdmin with the command serve:

    cd ~/Code
    serve phpmyadmin.app /home/vagrant/Code/phpMyAdmin/
    

    Thats it!

    Go to http://phpmyadmin.app it should work, and you can login with your user and password homestead default. The great thing about this method is that you can set up your phpmyadmin so long as you keep it in your Homestead.yaml file and phpMyAdmin in your Code directory.

提交回复
热议问题