Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate newrelic.ini files created when installing PHP APM agent with install script on Ubuntu and Debian servers #852

Open
tbrack opened this issue Mar 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tbrack
Copy link

tbrack commented Mar 14, 2024

Description

My team has been implementing New Relic monitoring on several PHP applications we support, and every time we install the agent it creates a second 20-newrelic.ini file. This causes a second APM app named "PHP Application" to begin reporting to New Relic which increases our ingest costs.

This occurs when using the guided install script as well as using the Ansible newrelic-install role. I believe the ansible role extends the guided install script so I suspect its the same issue.

Steps to Reproduce

  1. Install PHP on an Ubuntu server
  2. Run the New Relic guided install script
curl -Ls https://download.newrelic.com/install/newrelic-cli/scripts/install.sh | bash && sudo NEW_RELIC_API_KEY=xxxxx NEW_RELIC_ACCOUNT_ID=xxxxxx /usr/local/bin/newrelic install
  1. When prompted to install PHP agent select yes
  2. Enter a unique application name
  3. Complete the install
  4. Run php -i | grep newrelic

Expected Behavior

There should be one newrelic.ini file. There shouldn't be an additional 20-newrelic.ini file.
The ini file should have the newrelic.appname specified during the install process.
Only the new app should show up in the New Relic APM Services console.

Relevant Logs / Console output

php -i | grep newrelic
PHP Warning:  Module "newrelic" is already loaded in Unknown on line 0
/etc/php/8.1/cli/conf.d/20-newrelic.ini,
/etc/php/8.1/cli/conf.d/newrelic.ini


ls -l /etc/php/8.1/cli/conf.d/20-newrelic.ini
lrwxrwxrwx 1 root root 40 Mar 14 00:00 /etc/php/8.1/cli/conf.d/20-newrelic.ini -> /etc/php/8.1/mods-available/newrelic.ini


cat /etc/php/8.1/cli/conf.d/20-newrelic.ini | grep newrelic.appname
; Setting: newrelic.appname
newrelic.appname = "Test App"

cat /etc/php/8.1/cli/conf.d/newrelic.ini | grep newrelic.appname
; Setting: newrelic.appname
newrelic.appname = "PHP Application"

Your Environment

I've observed this on Ubuntu 22.04.3 LTS and Debian GNU/Linux 11 (bullseye)

Seen with both php 8.1 and php8.2, as well as both nginx and apache webservers.

Additional context

These servers run on AWS EC2 and were built using the AWS quickstart templates for Ubuntu and Debian.

@tbrack tbrack added the bug Something isn't working label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant