From fa07406f4dccd482284cb9d8dbaca6533116dab8 Mon Sep 17 00:00:00 2001 From: Samruddhi Khandale Date: Mon, 13 Jun 2022 13:30:57 -0700 Subject: add missing user groups to fix permission issues for non root user (#45) * add missing user groups * fix username * move chmod: anaconda --- src/php/install.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/php/install.sh') 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!" -- cgit v1.2.3