Installing Laravel 4 on Dreamhost

March 12th, 2013

You’re going to need access to ssh for all of this to work.

Now we need to do is to enable Phar and install Composer.  Geekality has a nice tutorial on how to do that.  The one issue I had with those instructions is the section on how to install composer didn’t work.  The install directory couldn’t be found.  I think the way curl is configured on Dreamhost, it doesn’t recognize the shorthand for your home director (~).  I just manually typed in the full path instead.

$ curl -s https://getcomposer.org/installer | php -- --install-dir=/home/username/bin
$ chmod u+x ~/bin/composer.phar
$ composer.phar

Next we need to configure Dreamhost to host a Laravel application.  Log in to the control panel and navigate to Domains > Manage Domains.  Edit the domain where you wish to have Laravel 4 run from.  First we should change the web directory from the default /home/username/mysite.com to /home/username/mysite.com/public. The reason we do this is that some of Laravel lives outside of the root web directory.  Next we need to make sure PHP is set to 5.3.x or higher.  I like the FastCGI version.

Once you completed those steps it's onto installing Laravel 4. The docs are a good start.  Download the latest build and place the files in /home/username/mysite.com.  Now from this directory in ssh you’ll need to run the install command.  The ones in the instructions didn’t work for me, it couldn’t find composer and I ran out of memory, but this one did php -d memory_limit=256M ~/bin/composer.phar install.  After that the Laravel docs are great for anything else you need.

Have fun.