Heroku/PHP Quick Tip #1 – Webroot

So I checked out Heroku yesterday after the official support for PHP announcement. I pushed up a basic install of Laravel 4.1 to a new free account. However, if you just create your repo, set up Laravel, and do a git push origin master , your webroot will be the project root, not /public. After reading about “buildpacks”, etc., I found out that all you need to do is create an empty file in the project root named “Procfile” and add:web: vendor/bin/heroku-php-apache2 public to it (assuming you are using Apache). I saw something else showing custom composer.json settings for heroku that defined the webroot, but I couldn’t get that to work.

Heroku/PHP Quick Tip #2 – Adding PHP extensions

If you are used to using Composer, adding PHP extensions to a Heroku PHP app is really easy. For adding the GD library, just add the extension as follows to the “require” section of your project’s composer.json file:

"require": 
{ 
‚Äč   "ext-gd": "*", 
    "laravel/framework": "4.1.28", 
    "doctrine/dbal": "2.4.2", 
    "guzzlehttp/guzzle": "4.0.2", 
    "way/generators": "2.6", 
    "fzaninotto/faker": "v1.3.0" 
},

Heroku has a complete list of already included extensions and those available to be added during deployment.