[PHP] Agent installation issues

Hi all,
I am attempting to bake the php agent into an AMI image built using packer so I am trying to script the installation and remove human interaction.

The problem I am hitting is the install guide is wrong and the agent setup is actually started by the apt-get install newrelic-php5 line meaning when newrelic-install install is called it starts duplicating the ini files.

From looking at various other posts this error seems to have been around for a long time which leads me to believe I am doing something wrong otherwise it would have been fixed!

Does anyone know how to run apt-get install newrelic-php5 without triggering the install script?

Thanks

Hey @arthur27

I’m liasing with the PHP Engineering team. We’re investigating what appears to be an unusual behaviour happening with the install scripts, might be a minor bug.

The repository install does place a lot of get files in the right place. The install script largely do check for alternative versions of PHP, asks if you want to install against them and amends the config file to include your license key. (so making sure the correct .so extension file for the right PHP version goes where it needs to).

So I guess you’re packing it into the AMI so in this example, apart from the duplicate, the files being where they need to be is actually OK since that’s what you want to have all packed into the AMI. So is it the scripting of the use of newrelic-install to set the license key that’s mostly the priority?

1 Like

@arthur27 Given the uniqueness of this issue I went ahead and opened a ticket for you on this so that our support team can continue to work on this with our engineers. Thanks for your patience as the investigation continues :slight_smile:

Hi,
I think the two different install processes seem to place their own ini files resulting in two instances of newrelic and warning messages every time the php interpreter is run.

I didn’t check this myself but one report talked of a simple newrelic.ini file and a weighted 20-newelic.ini file which would explain this.

The duplicate ini might also explain why the sed config updates that you include in your install script didn’t work for me as they rely on the php interpreter returning a path not a warning message.

Thanks

That’s interesting, it shouldn’t created a weighted ini and a normal newrelic.ini but weighted ini files I believe are specific to certain distro’s of Linux.

I think Joi created a support ticket on your behalf if you can ensure to liase this information to them, we spotted a few unusual items in the installer on the back of me trying to check this out for you so they are going to investigate but the more detail then the better chance they hit the nail with any work they do solve for.

For now (in the interim) might it be possible to add to the packing script to remove newrelic.ini and just make adjustments to the 20-newrelic.ini. You should only need one ini, in it there will be an extension call that loads our newrelic.so. As long as that file has your license key and appName as needs you should be good to go and hopefully we can figure this out and get a cleaner run of the install process for you

The weighted ini is installed as part of the apt-get install so the method I had tried was to skip the proper newrelic-install install process. Does that install process do anything else or is it just creating the ini file?

The other aspect that concerns me about this approach is what happens when you fix the installer, all of a sudden the ini file that I am expecting to be there will be gone and this process will break.

Is the investigation and fix of this process something thats being looked at now or is it likely to be a long term issue?

Thanks

Hi @arthur27, I can see that our support team are awaiting a reply from you on your support ticket. They will be the best equipped to deal with your installation issues so I would recommend responding on the ticket when you get the chance :slightly_smiling_face:

Hi, sorry, I thought the support ticket was an internal one and the emails that were coming through were forum replies and kept deleting them. I will have a look and see what I have missed!

No worries at all! I get it, it can be confusing. Let me know if you need anything else!