Installation on Heroku

Protect your applications on Heroku with Sqreen


The Sqreen PHP agent and Heroku

Heroku is a PaaS (Platform as a Service) hosting web applications. Sqreen supports Heroku for PHP applications.

See our Heroku page for more information.

Installation for Heroku apps

Sqreen supports all available major PHP versions on all the Heroku buildpacks. As of the time of writing, this means PHP 5.6-7.3 in cedar-14 and heroku-16 and PHP 7.1-7.3 in heroku-18. The installation involves several steps.

First, add the Sqreen addon to your application. This automatically defines the SQREEN_TOKEN environment variable.

Second, add an extra repository to the application. The repository to use varies according to your buildpack:

# cedar-14
heroku config:set HEROKU_PHP_PLATFORM_REPOSITORIES="https://sqreen-heroku.s3.amazonaws.com/dist-cedar-14-stable/"

# heroku-16
heroku config:set HEROKU_PHP_PLATFORM_REPOSITORIES="https://sqreen-heroku.s3.amazonaws.com/dist-heroku-16-stable/"

# heroku-18
heroku config:set HEROKU_PHP_PLATFORM_REPOSITORIES="https://sqreen-heroku.s3.amazonaws.com/dist-heroku-18-stable/"

Finally, edit your composer.json file. Add ext-sqreen to the require section, and to the config/platform section:

{
    ...
    "require": {
        "php": "^7.1.3",
        "ext-sqreen": "^1.10",
        ...
    },
    ...
    "config": {
        "platform": {
            "php": "7.1.3",
            "ext-sqreen": "1.10.0"
        },
        ...
    },
    ...
}

Then commit and deploy. The installation is complete. You can check the logs to confirm.

More information on Heroku

Learn more about using Sqreen with Heroku on the Heroku Marketplace: