Platform.sh User Documentation

PHP

Get your license key Anchor to this heading

Sign up at https://newrelic.com and get your license key.

Add your license key Anchor to this heading

Add your New Relic license key as an environment level variable:

platform variable:create --level environment --environment <ENVIRONMENT-NAME> --visible-build false --inheritable false --json false --sensitive true --enabled true --visible-runtime true php:newrelic.license --value '<YOUR-NEW-RELIC-LICENSE-KEY>'

Give your application a name Anchor to this heading

Add a new environment level variable to give your application a recognizable name:

platform variable:create --level environment --environment <ENVIRONMENT-NAME> --visible-build false --inheritable false --json false --sensitive true --enabled true --visible-runtime true php:newrelic.appname --value <APP-NAME>

Enable the New Relic extension Anchor to this heading

Enable the New Relic extension in your .platform.app.yaml as follows:

runtime:
    extensions:
        - newrelic

Push the changes to your Platform.sh environment to enable New Relic as follows:

git add .platform.app.yaml
git commit -m "Enable New Relic."
git push

That’s it! You need to wait a little bit for your New Relic dashboard to be generated.

Troubleshoot Anchor to this heading

Additionally, you can check that your application is properly connected to New Relic by looking at the /var/log/app.log file:

platform log app

2017/04/19 14:00:16.706450 (93) Info: Reporting to: https://rpm.newrelic.com/accounts/xxx/applications/xxx
2017/04/19 14:00:16.706668 (93) Info: app 'xxx-main-xxx.app' connected with run id 'xxx'

Is this page helpful?