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

Add support for newrelic on PHP 8.4, fix installing newrelic on PHP 7.0/7.1 #1047

Merged
merged 3 commits into from
Jan 22, 2025

Conversation

javespi
Copy link
Contributor

@javespi javespi commented Jan 21, 2025

@javespi
Copy link
Contributor Author

javespi commented Jan 22, 2025

Hey @mlocati, looks like agent is no longer supported for 7.0 and 7.1 and I guess we are downloading latest version of extension in the script you did (#910).

What do you think is best here? Should we drop too supporting those 2 versions? CI is failing in PHP 7.1 if I'm not wrong

image
https://docs.newrelic.com/docs/apm/agents/php-agent/getting-started/php-agent-compatibility-requirements/

I'll remove those 2 versions unless you think there is any other workaround

Thank you!

@javespi javespi changed the title Add support for newrelic on PHP 8.4 Add support for newrelic on PHP 8.4 (and drop 7.0 and 7.1) Jan 22, 2025
@mlocati
Copy link
Owner

mlocati commented Jan 22, 2025

Instead of dropping support for old PHP versions, what about changing the installNewRelic function this way?

 installNewRelic() {
 	printf '# Installing newrelic\n'
+	# see https://docs.newrelic.com/docs/apm/agents/php-agent/getting-started/php-agent-compatibility-requirements/
+	if test $PHP_MAJMIN_VERSION -le 701; then
+		installNewRelic_baseUrl=https://download.newrelic.com/php_agent/archive/10.21.0.11/
+	else
+		installNewRelic_baseUrl=https://download.newrelic.com/php_agent/release/
+	fi
 	installNewRelic_search='\bnewrelic-php[0-9.]*-[0-9]+(\.[0-9]+)*-linux'
 	case "$DISTRO" in
 		alpine)
 			installNewRelic_search="$installNewRelic_search-musl"
 			;;
 	esac
-	installNewRelic_file="$(curl -sSLf -o- https://download.newrelic.com/php_agent/release/ | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)"
-	installNewRelic_url="https://download.newrelic.com/php_agent/release/$installNewRelic_file"
+	installNewRelic_file="$(curl -sSLf -o- "$installNewRelic_baseUrl" | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)"
+	installNewRelic_url="$installNewRelic_baseUrl$installNewRelic_file"

@javespi javespi changed the title Add support for newrelic on PHP 8.4 (and drop 7.0 and 7.1) Add support for newrelic on PHP 8.4 Jan 22, 2025
@javespi
Copy link
Contributor Author

javespi commented Jan 22, 2025

@mlocati thank you! Already commit the change 😉

@mlocati mlocati changed the title Add support for newrelic on PHP 8.4 Add support for newrelic on PHP 8.4, fix installing newrelic on PHP 7.0/7.1 Jan 22, 2025
@mlocati mlocati merged commit fe56d57 into mlocati:master Jan 22, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants