This one isn’t Vagrant specific but I’m sure this is where it crops up regularly. Most provisioners do not include phpMyAdmin and I like me some phpMyAdmin. Many tutorials out there will get you to add something to your hosts file which I really don’t want to do. I want to be able to go to any base URL on my dev environment and append /phpmyadmin to it to access it.

The first step is logging in to your Vagrant box via vagrant ssh and grabbing phpMyAdmin using the following command.

sudo apt-get install phpmyadmin

You’ll need to accept the 17.4MB-ish of space it will take and then do some config. I select apache2 to configure for automatically and I skip the dbconfig-common part. To be honest I messed up last time and chose yes at the last stage and provided my database details and everything worked fine, so you can’t really go wrong.

Once you’re done you’ll need to add a line to your apache config file:

Include /etc/phpmyadmin/apache.conf

Your apache config is probably in /etc/apache2/apache2.conf. I use sudo vi /etc/apache2/apache2.conf to open the file and just plop that line on top. Restart your server and you’re done.

sudo service apache2 restart

phpMyAdmin should now be up and running, just go to your server’s IP and append /phpmyadmin or to any virtual host you have and do the same.