Skip to content

Commit 9dc57f5

Browse files
chore(php): made changes to correct dirs
1 parent 98e76dc commit 9dc57f5

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

recipes/newrelic/apm/php/debian.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,17 +458,32 @@ 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}}"
461463
INI_DIRS=($WEB_INI_DIR $CLI_INI_DIR)
462464
for dirs in $INI_DIRS; do
463465
for ini in $dirs; do
466+
echo -e "{{.YELLOW}}ini path is $ini{{.GRAY}}"
464467
#
465468
# Get the PHP INI Directory associated with this specific NR INI file
466469
#
467470
php_ini_dir=$(echo $ini | sed -n 's/\(.*\)\/conf.d/\1/p')
468471
if [ -z "${php_ini_dir}" ]; then
469-
php_ini_dir=$ini
472+
if [[ "$dirs" == "$WEB_INI_DIR" ]]; then
473+
if [[ -d "${ini}/../apache2/conf.d" ]]; then
474+
php_ini_dir="${ini}/../apache2/conf.d"
475+
fi
476+
if [[ -d "${ini}/../fpm/conf.d" ]]; then
477+
php_ini_dir="${ini}/../fpm/conf.d"
478+
fi
479+
elif [[ "$dirs" == "$CLI_INI_DIR" ]]; then
480+
php_ini_dir="${php_ini_dir}/../cli/conf.d"
481+
else
482+
echo -e "something went wrong while checking for paths"
483+
php_ini_dir=${ini}
484+
fi
470485
fi
471-
486+
echo -e "{{.YELLOW}}php ini dir path is: $php_ini_dir{{.GRAY}}"
472487
#
473488
# Get the PHP Binary directory associated with this particular NR INI file.
474489
sed_slash_ini=$(echo "${ini}" | sed 's/\//\\\//g')

0 commit comments

Comments
 (0)