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

Stable / Latest php_agent Download URI?


#1

Is there a ‘stable’ or ‘latest’ download URI for php_agent tarballs? The deletion of old versions and changing filename with new versions often breaks our build processes. Thanks!


#2

Hey @jsanford

How are you doing it currently. That context might help us understand the barrier you’re hitting.

The latest PHP agent can always be found here.
http://download.newrelic.com/php_agent/release/


#3

Hi @acuffe,

That works well if you are a human, however my concern lies in not having a persistent URI available for Docker or other automated builds to reference php_agent. As an example:

http://download.newrelic.com/php_agent/release/newrelic-php5-7.2.0.191-linux-musl.tar.gz

will some day change to:

http://download.newrelic.com/php_agent/release/newrelic-php5-7.3.0.xxx-linux-musl.tar.gz

This wouldn’t be a terrible issue, however, each NewRelic release seems to include a step that deletes the previous version. As a result, any automated builds, Docker containers, Chef recipes, Ansible playbooks etc. 404 trying to download the php_agent as soon as you release a new version.

This problem is often mitigated by other upstream providers by offering a ‘stable’ or ‘latest’ file - generally a symlink to the latest version. E.g.:

http://download.newrelic.com/php_agent/release/newrelic-php5-latest-linux-musl.tar.gz

That would be ideal for the php_agent as well!

Regards,

Jake


#4

Hey @jsanford

Is it Docker you’re trying to ensure that deploying new containers contains the latest agent?

This is a sample Dockerfile to achieve such.

RUN apt-get install -y wget
RUN echo deb http://apt.newrelic.com/debian/ newrelic non-free >> /etc/apt/sources.list.d/newrelic.list
RUN wget -O- https://download.newrelic.com/548C16BF.gpg | apt-key add -
ENV NR_INSTALL_SILENT true
ENV NR_INSTALL_KEY your_licenseKey_number
RUN apt-get update
RUN apt-get install -y newrelic-php5 
RUN newrelic-install install

Does this help you in any way? In this way when the Dockerfile is built and executed it’s installing the latest agent from a repository. Perhaps there’s a more specific use case in your scenario, if so if you can detail something specific I can investigate that and if it’s something we currently don’t have an option for, I can feed this back to our PHP Agent developers to consider such a solution going forward.


#5

Hi @acuffe

Thanks for the quick reply! We are currently using Alpine linux based containers, so Debian packages aren’t unfortunately of use. This is why we’re using the agent direct download URI. I would appreciate passing it on!

Regards,

Jake


#6

It seems this issue (ticket?) has been resolved but the latest/stable ‘tag’ is still not available from https://download.newrelic.com/php_agent/release/
We are also using Alpine container images and would really like to see such a tag instead of the hackisch work-a-round of grepping html.
@acuffe is this still on your roadmap if getting solved? It would seem a small trivial change to me.


#7

@daniel.kraaij the musl release should work for Alpine linux as Alpine works on a version of C called MUSL C which mean if you download and use the version in the latest release folder you have referenced and take down the musl option you should be successful.

That release folder is always the latest/stable release and then you just need to choose the option which is relevant to your environment.


#8

Hi @acuffe,

Thanks for you answer.

Perhaps i have explained myself wrong here :wink:
We have automatic container builds that pick up the NewRelic PHP agent from that directory.
At this moment we are doing a dirty work-a-round for getting the correct version of the musl file.

NEWRELIC_FILE=$(curl -s https://download.newrelic.com/php_agent/release/ | grep -o ‘newrelic-php5-\(\d\+.\)+-linux-musl.tar.gz’ | head -n 1) || exit; \
curl -L https://download.newrelic.com/php_agent/release/${NEWRELIC_FILE} | tar -C /tmp -zx

This is obviously not the correct way of doing things.
We would rather do a

curl -L https://download/newrelic/com/php_agent/release/newrelic-php5-latest-linux-musl.tar.gz | tar -C /tmp -zx


#9

Can i assume by the lack of response that a change request has been put in for this?


#10

Hey @daniel.kraaij - Sorry we missed this thread - I’m looking into why that happened…

Anyway, you’re right, there is a feature request logged for this, and at the moment it looks like your workaround is the best available option.