Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Relic Solution: Using New Relic with Bitnami

level-up
relic-solutions

#1

Bitnami is a application automation tool which can install and setup many popular applications like Wordpress and Drupal from scratch, including PHP and Apache. AWS even uses it to automatically setup instances with Wordpress for you.

To do this, Bitnami has a custom build of PHP it uses with all the required modules for your selected application. This custom build causes issues for our normal install method.

The Details

Bitnami builds PHP without –with-config-file-scan-dir so there is no “Scan this dir for additional .ini files” setting. We rely on this to place our newrelic.ini which tells PHP to load New Relic as well as defines things like your appname. This means that a Bitnami system will not load New Relic because it does not load the newrelic.ini.

This means we need to do a manual install of the agent by copying the newrelic.so to the appropriate PHP extension_dir and copy the contents of a newrelic.ini to the loaded php.ini

How to fix it

  1. Download the latest PHP Agent for Linux from here: http://download.newrelic.com/php_agent/release/

  2. Create a phpinfo() page. This will tell us the locations of the files we need.

  3. In your phpinfo() page, locate the Loaded Configuration File setting. This will be something like /opt/drupal-8.6.1-0/php/etc/php.ini

  4. Copy the contents of a newrelic.ini to the end of the above php.ini. Be sure to add your chosen newrelic.appname and license key

  5. In your phpinfo() page, locate the PHP Extension build number, something like 20160303, and the extension_dir, something like /opt/drupal-8.6.1-0/php/lib/php/extensions and the Thread Safety value.

  6. From the agent install files in ./agent/x64/ , find the newrelic-XXXXXXXX.so if Thread Safety is disabled or newrelic-XXXXXXXX-zts.so if it is enabled where the number matches your build number from the previous step. Copy it to the extension_dir and rename it newrelic.so

  7. Restart bitnami using /etc/init.d/bitnami restart or the bitnami control script.