aboutsummaryrefslogtreecommitdiff
path: root/src/php
diff options
context:
space:
mode:
authorSamruddhi Khandale <skhandale@microsoft.com>2022-06-13 23:30:57 +0300
committerGitHub <noreply@github.com>2022-06-13 23:30:57 +0300
commitfa07406f4dccd482284cb9d8dbaca6533116dab8 (patch)
tree438c8fd7b17b3d69ecede41ea0bdea99fe0e4eea /src/php
parent19fd66af965b22f57fd59a0ba31136146b9542d1 (diff)
add missing user groups to fix permission issues for non root user (#45)
* add missing user groups * fix username * move chmod: anaconda
Diffstat (limited to 'src/php')
-rw-r--r--src/php/install.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/php/install.sh b/src/php/install.sh
index 6956292..847f50f 100644
--- a/src/php/install.sh
+++ b/src/php/install.sh
@@ -40,7 +40,7 @@ if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
fi
done
if [ "${USERNAME}" = "" ]; then
- USERNAME=vscode
+ USERNAME=root
fi
elif [ "${USERNAME}" = "none" ]; then
USERNAME=root
@@ -122,6 +122,11 @@ if [ -d "${PHP_INSTALL_DIR}" ]; then
exit 1
fi
+if ! cat /etc/group | grep -e "^php:" > /dev/null 2>&1; then
+ groupadd -r php
+fi
+usermod -a -G php "${USERNAME}"
+
PHP_URL="https://www.php.net/distributions/php-${VERSION}.tar.gz"
PHP_INI_DIR="${PHP_INSTALL_DIR}/ini"
@@ -192,4 +197,8 @@ rm -rf ${PHP_SRC_DIR}
updaterc "if [[ \"\${PATH}\" != *\"${CURRENT_DIR}\"* ]]; then export PATH=${CURRENT_DIR}/bin:\${PATH}; fi"
+chown -R :php "${PHP_DIR}"
+chmod -R g+r+w "${PHP_DIR}"
+find "${PHP_DIR}" -type d | xargs -n 1 chmod g+s
+
echo "Done!"