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

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


Option 1:

This will install the latest version of PhpMyAdmin from a shell script I've written. You are welcome to check it out on Github.

  1. Run the following command from your code/projects directory:

     curl -sS https://raw.githubusercontent.com/grrnikos/pma/master/pma.sh | bash

Option 2:

This will install PhpMyAdmin (not the latest version) from Ubuntu's repositories. Assuming that your projects live in /home/vagrant/Code :

  1. sudo apt-get install phpmyadmin Do not select apache2 nor lighttpd when prompted. Just hit tab and enter.

  2. sudo ln -s /usr/share/phpmyadmin/ /home/vagrant/code/phpmyadmin

  3. cd ~/Code && serve phpmyadmin.test /home/vagrant/code/phpmyadmin

Note: If you encounter issues creating the symbolic link on step 2, try the first option or see Lyndon Watkins' answer below.

Final steps:

  1. Open the /etc/hosts file on your main machine and add:

     127.0.0.1  phpmyadmin.test
  2. Go to http://phpmyadmin.test:8000


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/phpMyAdminsites:    - 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.


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/phpmyadmincd ~/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!)