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

前端 未结 14 1274
无人共我
无人共我 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条回答
  • 2020-12-12 10:19

    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!)

    0 讨论(0)
  • 2020-12-12 10:21

    Step 1:

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

    Step 2:

    Open up homestead.yaml file and add these lines

    folders:
        - map: /Users/{yourName}/Code/phpMyAdmin
          to: /home/vagrant/Code/phpMyAdmin
    sites:
        - map: phpmyadmin.test
          to: /home/vagrant/Code/phpMyAdmin
    

    Step 3:

    Open your hosts file and add this line:

    127.0.0.1 phpmyadmin.test
    

    Step 4:

    You may need to run vagrant provision to load the new configuration if vagrant is already running.


    Thats it

    Go to http://phpmyadmin.test:8000. It should work from there. Great thing about this method is that if you ever need to destroy your box, you won't ever have to set up phpMyAdmin again so long as you keep your homestead.yaml file and phpMyAdmin in your code directory.

    ===========

    Important update from DaneSoul:

    I tried this instruction on Homestead 5.3 and have met a problem "No input file specified" when trying open http://phpmyadmin.test.

    And finnaly I found solution:

    You need unpack phpmyadmin to

    /home/vagrant/Code/phpMyAdmin/public
    

    And write in homestead.yaml

    - map: phpmyadmin.test
      to: /home/vagrant/Code/phpMyAdmin/public
    

    So almost all the same, but this /public directory in paths makes it working!

    Also, in my configuration I use http://phpmyadmin.test, not http://phpmyadmin.test:8000.

    Update Note: Follow this article to change your domain extension.

    0 讨论(0)
提交回复
热议问题