diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index 6927e8e9..6598f68a 100644 --- a/src/scripts/darwin.sh +++ b/src/scripts/darwin.sh @@ -95,7 +95,6 @@ add_unstable_extension() { add_tool() { url=$1 tool=$2 - tool_path_dir=/usr/local/bin tool_path="$tool_path_dir/$tool" if [ ! -e "$tool_path" ]; then rm -rf "$tool_path" @@ -186,7 +185,8 @@ tick="✓" cross="✗" version=$1 old_versions="5.[3-5]" -php5=/usr/local/php5 +php5="/usr/local/php5" +tool_path_dir="/usr/local/bin" existing_version=$(php-config --version | cut -c 1-3) [[ -z "${update}" ]] && update='false' || update="${update}" @@ -205,7 +205,7 @@ else status="Found" fi ini_file=$(php -d "date.timezone=UTC" --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g") -sudo chmod 777 "$ini_file" +sudo chmod 777 "$ini_file" "$tool_path_dir" echo "date.timezone=UTC" >>"$ini_file" echo "detect_unicode=Off" >>"$ini_file" ext_dir=$(php -i | grep -Ei "extension_dir => /usr" | sed -e "s|.*=> s*||") diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index 6d42996c..716fc08f 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -148,7 +148,6 @@ update_extension() { add_tool() { url=$1 tool=$2 - tool_path_dir=/usr/local/bin tool_path="$tool_path_dir/$tool" if [ ! -e "$tool_path" ]; then rm -rf "$tool_path" @@ -274,6 +273,7 @@ version=$1 old_versions="5.[4-5]" debconf_fix="DEBIAN_FRONTEND=noninteractive" apt_install="sudo $debconf_fix apt-fast install -y" +tool_path_dir="/usr/local/bin" existing_version=$(php-config --version | cut -c 1-3) [[ -z "${update}" ]] && update='false' || update="${update}" @@ -317,5 +317,5 @@ semver=$(php_semver) ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g") ext_dir=$(php -i | grep "extension_dir => /" | sed -e "s|.*=> s*||") scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||") -sudo chmod 777 "$ini_file" +sudo chmod 777 "$ini_file" "$tool_path_dir" add_log "$tick" "PHP" "$status PHP $semver"