<p>This method uses New Relic's PHP API, rather than php.ini, and is working well for me. It seems to be catching everything that I need to monitor. Any applications I've not done this for remain in the default application.</p>

<p>Just stick this in Craft's index.php file:</p>

<pre><code>if (extension_loaded('newrelic')) {
    newrelic_set_appname('NAME OF SITE');
}
</code></pre>

<p>I haven't tried it with ExpressionEngine or Wordpress, but the principle would be the same?</p>

CC BY-SA 3.0
2014-12-19T09:27:44.157Z
2014-12-19T09:27:44.157Z
Clive Portman
<p>Looks like this <a href="https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/renaming-applications#php" rel="nofollow">can be done</a> with a <code>php.ini</code> file in Craft's public HTML folder.</p>

<p>Although, we should be able to call an <code>ini_set</code> for it in Craft itself.  If you want to hit up support@buildwithcraft.com, I'll give you a file that you can test with.</p>

CC BY-SA 3.0
2014-10-13T21:29:16.093Z
2014-10-15T18:01:30.107Z
2014-10-15T18:01:30.107Z
Brad Bell
<p>Like many of you, we've started to use New Relic to deep dive into performance of our websites.</p>

<p>Right now, we have a client's production server that has a version of Craft, ExpressionEngine and Wordpress. </p>

<p>Right now WP and Craft get lumped together as a 'PHP application'. Is there any config setting to allow us to set 'Craft CMS' as a thing to differentiate?</p>

<p>We've been able to do this with EE.</p>

<config><newrelic>
Set the application name for Craft in New Relic
# Set the application name for Craft in New Relic

(Asked by: username_0 on 2014-10-13)

Like many of you, we've started to use New Relic to deep dive into performance of our websites.

Right now, we have a client's production server that has a version of Craft, ExpressionEngine and Wordpress.

Right now WP and Craft get lumped together as a 'PHP application'. Is there any config setting to allow us to set 'Craft CMS' as a thing to differentiate?

We've been able to do this with EE.

**Tags:** config, newrelic

---

## 2 answers

### Answer by username_1 on 2014-12-19. Score: 2 | Accepted answer

This method uses New Relic's PHP API, rather than php.ini, and is working well for me. It seems to be catching everything that I need to monitor. Any applications I've not done this for remain in the default application.
Just stick this in Craft's index.php file:
if (extension_loaded('newrelic')) {
    newrelic_set_appname('NAME OF SITE');
}

I haven't tried it with ExpressionEngine or Wordpress, but the principle would be the same?


---

### Answer by username_2 on 2014-10-13. Score: 1

Looks like this [can be done](https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/renaming-applications#php) with a `php.ini` file in Craft's public HTML folder.

Although, we should be able to call an `ini_set` for it in Craft itself. If you want to hit up support@buildwithcraft.com, I'll give you a file that you can test with.


---

