Skip to content

Commit 56012d8

Browse files
committed
smart way to hanlde php.ini
1 parent 80bf642 commit 56012d8

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

install/vst-install-debian.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ set_default_value() {
105105
fi
106106
}
107107

108+
108109
#----------------------------------------------------------#
109110
# Verifications #
110111
#----------------------------------------------------------#
@@ -853,10 +854,10 @@ ZONE=$(timedatectl 2>/dev/null|grep Timezone|awk '{print $2}')
853854
if [ -z "$ZONE" ]; then
854855
ZONE='UTC'
855856
fi
856-
sed -i "s/;date.timezone =/date.timezone = $ZONE/g" /etc/php5/apache2/php.ini
857-
sed -i "s/;date.timezone =/date.timezone = $ZONE/g" /etc/php5/cli/php.ini
858-
sed -i 's%_open_tag = Off%_open_tag = On%g' /etc/php5/apache2/php.ini
859-
sed -i 's%_open_tag = Off%_open_tag = On%g' /etc/php5/cli/php.ini
857+
for pconf in $(find /etc/php* -name php.ini); do
858+
sed -i "s/;date.timezone =/date.timezone = $ZONE/g" $pconf
859+
sed -i 's%_open_tag = Off%_open_tag = On%g' $pconf
860+
fi
860861

861862

862863
#----------------------------------------------------------#

install/vst-install-rhel.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -892,8 +892,10 @@ fi
892892
if [ -z "$ZONE" ]; then
893893
ZONE='UTC'
894894
fi
895-
sed -i 's%short_open_tag = Off%short_open_tag = On%g' /etc/php.ini
896-
sed -i "s%;date.timezone =%date.timezone = $ZONE%g" /etc/php.ini
895+
for pconf in $(find /etc/php* -name php.ini); do
896+
sed -i "s/;date.timezone =/date.timezone = $ZONE/g" $pconf
897+
sed -i 's%_open_tag = Off%_open_tag = On%g' $pconf
898+
fi
897899

898900

899901
#----------------------------------------------------------#

install/vst-install-ubuntu.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ set_default_value() {
9090
fi
9191
}
9292

93+
9394
#----------------------------------------------------------#
9495
# Verifications #
9596
#----------------------------------------------------------#
@@ -845,10 +846,10 @@ ZONE=$(timedatectl 2>/dev/null|grep Timezone|awk '{print $2}')
845846
if [ -z "$ZONE" ]; then
846847
ZONE='UTC'
847848
fi
848-
sed -i "s/;date.timezone =/date.timezone = $ZONE/g" /etc/php5/apache2/php.ini
849-
sed -i "s/;date.timezone =/date.timezone = $ZONE/g" /etc/php5/cli/php.ini
850-
sed -i 's%_open_tag = Off%_open_tag = On%g' /etc/php5/apache2/php.ini
851-
sed -i 's%_open_tag = Off%_open_tag = On%g' /etc/php5/cli/php.ini
849+
for pconf in $(find /etc/php* -name php.ini); do
850+
sed -i "s/;date.timezone =/date.timezone = $ZONE/g" $pconf
851+
sed -i 's%_open_tag = Off%_open_tag = On%g' $pconf
852+
fi
852853

853854

854855
#----------------------------------------------------------#

0 commit comments

Comments
 (0)