The correct way to install Laravel 5 on Heroku

Update: Please see the recent Heroku article https://devcenter.heroku.com/articles/getting-started-with-laravel for a fuller guide to this.

After reading a couple of contradictory posts by different developers on how to install Laravel on Heroku, this post gave the steps necessary:

Firstly (assuming the pre-requisites such as PHP, Mcrypt and Composer are installed, enter the following into your command line replacing <path> with either . for the current directory or any other directory path

composer create-project laravel/laravel —prefer-dist <path>

Right after all the composer download jazz has finished you need to create a Procfile for Heroku. Open an editor and paste as follows:

web: vendor/bin/heroku-php-apache2 public

Now you’ve finished with this you now need to add the files to a local git repository:

git init

git add .

git commit -m “First commit”

Now create the Heroku app:

heroku create

This will create the app and a heroku git remote. Before you push to Heroku you need to add the build pack to use to the heroku config:

heroku config:add BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-php

Now this is done, you can push your changes to Heroku:

git push heroku master

After a considerable amount of command line chatter use heroku open and you should see the default Laravel home page displayed.

Show your support

Clapping shows how much you appreciated Robert Coster’s story.