Heroku <3 PHP

Good news from Heroku: PHP is (finally) properly supported. Just add a composer.json file to your repo and Heroku will know your app runs PHP. Yes, you see that right: Composer is supported. Whenever you push your code to Heroku, it will install the dependencies if needed.

$ git add .
$ git commit -m "Add basic logging"
[master 4b42543] Add basic logging
 1 file changed, 14 insertions(+), 1 deletion(-)
$ git push heroku master
Fetching repository, done.
Counting objects: 15, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (12/12), 2.39 KiB | 0 bytes/s, done.
Total 12 (delta 3), reused 0 (delta 0)

-----> Fetching custom git buildpack... done
-----> PHP app detected
-----> Setting up runtime environment...
       - PHP 5.5.11
       - Apache 2.4.9
       - Nginx 1.4.6
-----> Installing dependencies...
       Composer version 1e4df0690a08c4653b5c932d51a337b10d6c19bf 2014-04-10 19:10:45
       Loading composer repositories with package information
       Installing dependencies from lock file
         - Installing psr/log (1.0.0)
           Downloading: 100%

         - Installing monolog/monolog (1.8.0)
           Downloading: 100%

       Generating optimized autoload files
-----> Building runtime environment...
       Loading composer repositories with package information
       Updating dependencies
         - Installing heroku/heroku-buildpack-php (dev-beta 20204c9)
           Loading from cache

       Writing lock file
       Generating optimized autoload files
-----> Discovering process types
       Procfile declares types -> web

-----> Compressing... done, 60.8MB
-----> Launching... done, v6
       http://polar-chamber-3014.herokuapp.com/ deployed to Heroku

To git@heroku.com:polar-chamber-3014.git
   bd24c74..4b42543  master -> master

Heroku PHP Support →
Getting Started with PHP on Heroku →

Related: TokenPhrase, a PHP class which generates unique phrases – comparable to Heroku’s generated hostnames – for you to use in your app as tokens

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.