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:
symfony2
zf2
zf1
silex
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
,web
orhtdocs
— 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 therequire
section? - How to handle traditional PHP apps, which call
.php
files from the doc root (e.g. Wordpress)?