Patrick Ward words, code, and music

Setting Up a Laravel Application on Webfaction

I was working on a simple Laravel 4 application for a client recently and decided to put it on the Webfaction hosting platform. The platform itself is quite nice, but in order to make the Laravel application work properly, I had to go through a series of steps:

Setting Up Composer

Installing composer took a few extra steps to avoid errors and fit within the directory structure of the Webfaction user account:

  cd ~
  ln -s `which php55` ~/bin/php
  export PATH=$HOME/bin:$PATH
  curl -sS | php53

Once composer was installed, I was able to cd into my webapp directory and run the composer update:

  cd ~/webapps/MyLaravelApp/
  php55 ~/composer.phar update

Setting Up the Web Application

Once composer was installed and the Laravel dependencies were added, I was able to continue deploying the application.

Webfaction uses web applications to drive individual webapps. At first, I thought I could just add the Laravel application. However, Laravel apps require the document root to be set to the public directory. So, using the regular Webfaction application for that won’t work. The recommended solution is to add a Symbolic Link application and add the absolute path of the public directory to the Extra Info section of the application setup.

  1. Within the control panel, go to “Domains/Websites –> Applications”
  2. Choose “Add a New Applciation”
  3. Enter the name of your application (e.g. MyLaravelApp_Public) - This is just a symbolic link to the public directory of the Laravel application I setup earlier.
  4. Choose “Symbolic link” for the “App Category”
  5. Choose the appropriate PHP version for the “App Type”
  6. Ener the absolute path of the Laravel public directory to the “Extra Info” text field. For example:


Next, add this symbolic link application as the root application:

  1. Within the control panel, go to “Domains/Websites –> Websites”
  2. Choose the website you’re working with
  3. Under “Contents” choose “Add an application –> Reuse and existing application”
  4. Choose the symbolic link application you created earlier.
  5. Finally, don’t for get to save the website

At this point, you should have a working Laravel application on the Webfaction hostng platform.