Skip to content

Commit f89514f

Browse files
fix(php): fixed php guided install receipe to accomadation recent php agent changes
1 parent 48c933f commit f89514f

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

recipes/newrelic/apm/php/debian.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -458,12 +458,9 @@ install:
458458
#
459459
460460
read -r APPLICATION_NAME < "{{.TMP_INSTALL_DIR}}/{{.USER_INPUT}}"
461-
echo -e "{{.YELLOW}}cli dir path after change is $CLI_INI_DIR{{.GRAY}}"
462-
echo -e "{{.YELLOW}}web dir path after change is $WEB_INI_DIR{{.GRAY}}"
463461
INI_DIRS=($WEB_INI_DIR $CLI_INI_DIR)
464462
for dirs in $INI_DIRS; do
465463
for ini in $dirs; do
466-
echo -e "{{.YELLOW}}ini path is $ini{{.GRAY}}"
467464
#
468465
# Get the PHP INI Directory associated with this specific NR INI file
469466
#
@@ -482,7 +479,6 @@ install:
482479
php_ini_dir=$ini
483480
fi
484481
fi
485-
echo -e "{{.YELLOW}}php ini dir path is: $php_ini_dir{{.GRAY}}"
486482
#
487483
# Get the PHP Binary directory associated with this particular NR INI file.
488484
sed_slash_ini=$(echo "${ini}" | sed 's/\//\\\//g')
@@ -515,8 +511,10 @@ install:
515511
fi
516512
517513
sed -i "s/newrelic.appname = \"[^\"]*\"/newrelic.appname = \"${APPLICATION_NAME}\"/" $ini_full_name
514+
518515
LICENSE_KEY="{{.NEW_RELIC_LICENSE_KEY}}"
519516
sed -i -E "s/newrelic.license = \"(REPLACE_WITH_REAL_KEY|)\"/newrelic.license = \"${NEW_RELIC_LICENSE_KEY}\"/" $ini_full_name
517+
520518
if [ "{{.NEW_RELIC_REGION}}" = "STAGING" ]; then
521519
sed -i 's/;newrelic.daemon.collector_host = ""/newrelic.daemon.collector_host = "staging-collector.newrelic.com"/' $ini_full_name
522520
sed -i 's/;newrelic.loglevel = "info"/newrelic.loglevel = "verbosedebug"/' $ini_full_name
@@ -549,11 +547,10 @@ install:
549547
# This ensures we always get the most up to date newrelic.ini file on the
550548
# system.
551549
#
552-
553-
source_dir=$(dirname "$(realpath "$ini_full_name")")
554-
destination_dir=$(realpath "$target_ini_dir")
555-
if [[ "$source_dir" != "$destination_dir" ]]; then
556-
mv "${ini_full_name}" "${destination_dir}"
550+
ini_source_dir=$(dirname "$(realpath "$ini_full_name")")
551+
ini_destination_dir=$(realpath "$target_ini_dir")
552+
if [[ "$ini_source_dir" != "$ini_destination_dir" ]]; then
553+
mv "${ini_full_name}" "${ini_destination_dir}"
557554
fi
558555
559556
#
@@ -666,8 +663,7 @@ install:
666663
info_text="{{.TMP_INSTALL_DIR}}/cli_info.txt"
667664
fi
668665
while read -r bin_loc php_ini_dir nr_ini_dir; do
669-
echo -e "bin_loc is ${bin_loc}, php_ini_dir is ${php_ini_dir} and nr_ini_dir is ${nr_ini_dir}"
670-
sudo -u $nonpriv_user $bin_loc -c "${php_ini_dir}/php.ini" -c "${nr_ini_dir}/newrelic.ini" -n --ini
666+
sudo -u $nonpriv_user $bin_loc -c "${php_ini_dir}/php.ini" -c "${nr_ini_dir}/newrelic.ini" -n --ini &>/dev/null
671667
done < "${info_text}"
672668
done
673669
else

0 commit comments

Comments
 (0)