Skip to content

Instantly share code, notes, and snippets.

Last active March 8, 2024 08:05
Show Gist options
  • Save JeffreyWay/af0ee7311abfde3e3b73 to your computer and use it in GitHub Desktop.
Save JeffreyWay/af0ee7311abfde3e3b73 to your computer and use it in GitHub Desktop.
Stop using MAMP. Here's a laughably simple way to get setup with a LAMP stack with PHP 5.5.
alias lamp="curl -L -o '' && curl -L -o 'Vagrantfile' && vagrant up"
Copy link

I managed to get both sites working - sort of.

I have one that is which refers to the vagrant directory (var/www on the vm) and index.php shows up there.
I have another on the same vm that is which refers to the codeshare folder inside vagrant directory (/var/www/codeshare on the vm) but that one displays the directory list instead of the laravel installation. I did the chmod thing and no luck. I ran php artisan serve and it says its already doing that.

Copy link

Thanks for this.
I am running this on Windows 8 and running this command in Git Bash.

I would add that it was hanging on the message "Verifying Hyper-V is enabled", this is because vboxmanage wasn't available and meant I had to add "C:\Program Files\Oracle\VirtualBox" to my Path environment variable

Copy link

ceesco53 commented Jul 8, 2014

Another thank you to @davecoggins

EDIT: I just reverted my config.vm.synced_folder line in vagrant back to the original settings. I opted to edit /etc/apache2/envvars and have apache2 run as vagrant user and group.

Copy link

Can anyone confirm if this still works? I haven't been able to get it to work at all.

To clarify: Running the script works fine and vagrant seems to be set up properly, but navigating to the server's IP address results in a 403 Forbidden error. I've followed to steps carefully, repeatedly, but no luck.

If anyone can confirm this still works properly, I guess I'll look into troubleshooting it further. Thanks.

Copy link

Yes this is work.

Copy link

Thanks heaps for this.... Can anyone please help me access the mysql from an IDE such as Sequel Pro. what is the ssh username and password?

Copy link

In windows, make lamp.bat and put this in:

curl -L -o
curl -L -o Vagrantfile
vagrant up

Copy link

vagrant ssh
mysql -u root -p
Follow steps to allow remote connection to my sql
Next connect from remote client Sequel Pro/MySQL Workbench to 192..168.33.21:3306

Copy link

Does anyone know what the username and password is for the VM? If say I wanted to SSH in without using Vagrant.

Great walkthrough by the way, and thanks @davecoggins, lifesaver!

Copy link

Found it, username = vagrant, password = vagrant. Sequel Pro now connects to the remote mysql without any extra configuration.

@JeffreyWay and @fideloper what are your thoughts on hosting the DB on the virtual server, now that it's so easy to set up its also easy to destroy, and lose all of your development data.

Copy link

are we updating this alias and setup?

Copy link

would be great if someone creates an for nginx php-fpm.

Copy link

tskamath commented May 7, 2015

could get the install to work.. Fixed the File with

edited the Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.provision "fix-no-tty", type: "shell" do |s|
    s.privileged = false
    s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile"
  end = "precise64"
  config.vm.box_url = "" :private_network, ip: ""
  config.vm.provision :shell, :path => ""
  config.vm.synced_folder ".", "/var/www"

Copy link

saqueib commented Aug 29, 2015

@JeffreyWay How can I install node.js on this box to use Elixir

Copy link

I think I've done something wrong. When I get to Step 4 above, here's what happens:

vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:


  • The box 'hashicorp/precise32' could not be found.

Please advise.


Copy link

jrvaja commented Dec 29, 2015

For Ubuntu 14.04 stack

alias lamp="curl -L -o '' && curl -L -o 'Vagrantfile' && vagrant up"


Copy link

Getting errors when running this culminating in the following;

The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

Full log here

I've listed the errors from the console output that were red below the gist in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment