diff options
author | Samruddhi Khandale <skhandale@microsoft.com> | 2022-06-13 23:30:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-13 23:30:57 +0300 |
commit | fa07406f4dccd482284cb9d8dbaca6533116dab8 (patch) | |
tree | 438c8fd7b17b3d69ecede41ea0bdea99fe0e4eea /src/php/install.sh | |
parent | 19fd66af965b22f57fd59a0ba31136146b9542d1 (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/install.sh')
-rw-r--r-- | src/php/install.sh | 11 |
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!" |