Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Heroku und PHP

Heroku und PHP

Slides from my talk at the Developer Conference 2013 in Hamburg. Not affiliated with Heroku.

Christoph Hochstrasser

November 07, 2013
Tweet

More Decks by Christoph Hochstrasser

Other Decks in Programming

Transcript

  1. Christoph Hochstrasser @hochchristoph github.com/CHH Blog: christophh.net Full-Stack Web Developer –

    Funemployed Contributor zu Composer, StackPHP. Creator von php-build.
  2. Um was gehts? • Was ist Heroku? • Das Problem

    mit Heroku und PHP • Buildpacks & Open Source to the rescue! • Rezepte für PHP Apps auf Heroku
  3. PHP

  4. Buildpack • Erlaubt die Verwendung eines eigenen Software Stacks auf

    Heroku • Pro App • Git Repository • Scripts (detect, compile, release) • Binaries von z.B. S3 • Mehr unter https://devcenter.heroku.com/articles/buildpack- api
  5. { "require": { "php": ">=5.3.0", "silex/silex": "~1.0@dev", "ext-libevent": "*" },

    "extra": { "heroku": { "document-root": "web", "index-document": "index.php", "php-config": [ "short_open_tag=on", "date.timezone=Europe/Vienna", "newrelic.appname=php-test" ], "engines": { "php": "5.4.*", "nginx": "1.4.*" }, "compile": [ ] } } } Framework php.ini Einstellungen Stack Versionen Shell Befehle Häufige Settings
  6. $ php composer.phar create-project symfony/framework-standard-edition Symfony 2.3.0 $ cd Symfony

    $ heroku create —buildpack git://github.com/CHH/heroku-buildpack-php —region eu $ git push heroku master
  7. Kandidaten für Config Vars: • S3 Bucket • Amazon Access

    Key/Secret • Datenbank Host, Port, Username, Passwort, Datenbankname • Redis Host • Secrets aller Art (Facebook,…) • Application Environment
  8. { … "extra": { "heroku": { … "compile": [ "php

    app/console assets:dump —env=prod" ] } } }
  9. Links • Heroku PHP Buildpack: github.com/CHH/heroku-buildpack-php • Heroku Buildpacks API:

    https://devcenter.heroku.com/articles/ buildpack-api • HHVM Buildpack: https://github.com/hhvm/heroku-buildpack-hhvm