This Heroku Buildpack adds more advanced support for PHP.
- Runs apps written for both PHP 5.4 and 5.3
- Supports Composer dependencies and caching of the
vendor/directory for fast deploys - Simple configuration via the project's
composer.json - Stable and fast setup using NGINX, PHP-FPM and Zend Optimizer Plus
This build pack gets enabled if the project has a file named composer.json in its project root. The simplest way to get set up
is to use a framework preset:
{
"extra": {
"heroku": { "framework": "symfony2" }
}
}Valid framework presets include:
symfony2zf2zf1silex
You can also configure the settings manually if you're not using one of the before listed frameworks.
The two main settings of interest are: document-root and index:
document-root: Publicly accessible files of your project. Typically namedpublic,weborhtdocs— but can also be the project's root (e.g. for Wordpress, or most CMS installs)index: This file receives all requests which don't specify an existing PHP file in the request URI.
- NGINX: http://chh-heroku-buildpack-php.s3.amazonaws.com/manifest.nginx
- PHP: http://chh-heroku-buildpack-php.s3.amazonaws.com/manifest.php
- How to handle custom extensions?
- Run
pecl install <extension>on everyext-entry in therequiresection? - How to handle traditional PHP apps, which call
.phpfiles from the doc root (e.g. Wordpress)?