kidk
kidk

Reputation: 93

Local composer update fails with new heroku php buildpack

When moving from our own PHP custom buildpack to the supported Heroku one we are running into a problem. Heroku requires us to add certain extensions to the composer.json "require" part, but when you then try to update locally it fails because these packages do not exists in the repo.

Config file:

    {
            "config":{
                    "github-oauth":{
                            "github.com":""
                    }
            },
            "require": {
                    "php": "*",
                    "ext-newrelic": "*",
                    "ext-memcached": "*",

                    "aws/aws-sdk-php": "2.*",
                    "rollbar/rollbar": "*",
                    "yiisoft/yii": "1.1.15",
                    "cloudinary/cloudinary_php": "1.0.11",
                    "geoip/geoip": "v1.14",
                    "sendgrid/sendgrid": "2.1.1",
                    "swiftmailer/swiftmailer": "v5.2.1",
                    "crisu83/yiistrap": "dev-bs3"
            },
            "require-dev": {
                    "phpunit/phpunit": "3.7.*",
                    "phpunit/dbunit": ">=1.2",
                    "phpunit/php-invoker": "*",
                    "phpunit/phpunit-selenium": ">=1.2",
                    "phpunit/phpunit-story": "*",
                    "squizlabs/php_codesniffer": "1.*",
                    "phpmd/phpmd" : "1.4.*",
                    "phploc/phploc": "*",
                    "pdepend/pdepend" : "1.1.0",
                    "sebastian/phpcpd": "*",
                    "mayflower/php-codebrowser": "~1.1"
            }
    }

Error message:

    11:08:55 {development} /Volumes/Development/web$ composer update

    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Your requirements could not be resolved to an installable set of packages.

      Problem 1
        - The requested PHP extension ext-newrelic * is missing from your system.
      Problem 2
        - The requested PHP extension ext-memcached * is missing from your system.

Any ideas ?

Upvotes: 3

Views: 1208

Answers (2)

dzuelke
dzuelke

Reputation: 2645

You need to install those extensions. The assumption is that you develop, run and test your code locally during development using roughly the same components and environment as in production, so if you use memcache in production, you also use it locally. That ensures you're not running into nasty surprises because different datastores behave differently etc. Also see http://12factor.net/dev-prod-parity

Exception to the rule: you don't need to install the New Relic extension; it's enabled automatically on push if you provision the New Relic add-on (by detecting NEW_RELIC_LICENSE_KEY env var), see https://devcenter.heroku.com/articles/php-support#extensions (it is of little use locally on a developer's box, and can be a bit troublesome to install).

Upvotes: 1

kidk
kidk

Reputation: 93

Installing the extensions fixed this for me (the newrelic extension is giving me trouble but that's another question.)

(Answer was posted here, but the person removed it again.)

Upvotes: 1

Related Questions