Skip to content

A more advanced PHP buildpack for Heroku, inspired by the Node.js buildpack

Notifications You must be signed in to change notification settings

AJ/heroku-buildpack-php-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advanced PHP Heroku Build Pack

What works?

  • Basic provisioning
  • NGINX Configuration for frameworks silex and symfony2
  • Reading configuration from composer.json

Stack

  • NGINX 1.2 or 1.3
  • PHP 5.3 or 5.4
  • PHP-FPM

Detection

This buildpack detects apps when the app has a composer.json in the app's root.

Configuration

Configuration is done via a file named composer.json in the app's root.

A simple configuration could look like this:

{
    "name": "my-app",
    "require": {
        "php": ">=5.4.0",
        "silex/silex": "~1.0@dev"
    },
    "extra": {
        "heroku": {
            "document-root": "web",
            "index-document": "index.php"
        }
    }
}

This configures an app with the document root set to the project's web directory, and sets that all requests should go through web/index.php which contains the application's front controller.

Configuration Directives

This buildpack supports configuration through directives placed in the heroku key in the extra object.

framework

Default: Null

Use a framework preset for configuration. Some configuration keys cannot be overriden!

Available presets:

  • silex (needs document-root and index-document set)
  • symfony2

Example:

"framework": "silex"

document-root

Document root relative to the app root. Defaults to the app root.

"document-root": "web"

index-document

Default: "index.php"

Index Document relative to the document root.

"index-document": "app.php"

engines

Set PHP and NGINX versions.

To launch the app with PHP 5.3.23 and NGINX 1.3.14:

"engines": {
    "php": "5.3.23",
    "nginx": "1.3.14"
}

See also:

php-config

Default: []

Add directives to the php.ini.

"php-config": [
    "display_errors=off",
    "short_open_tag=on"
]

compile

Status: Not Implemented

Default: []

Run console commands on slug compilation.

"compile": [
    "php app/console assetic:dump --env=prod --no-debug"
]

About

A more advanced PHP buildpack for Heroku, inspired by the Node.js buildpack

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Shell 100.0%