Skip to content

Commit 133c38e

Browse files
committed
update config dir to /etc/php/8.3
1 parent b4bbe02 commit 133c38e

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

app/run.sh

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -73,61 +73,61 @@ fi
7373
# Route mail to SMTP queuing servers
7474
#
7575
#####
76-
if [ ! -f /etc/php/7.4/apache2/build ]; then
76+
if [ ! -f /etc/php/8.3/apache2/build ]; then
7777

7878
# Tweak Apache Build
79-
sed -i 's|;include_path = ".:/usr/share/php"|include_path = ".:/usr/share/php:/data/pear"|g' /etc/php/7.4/apache2/php.ini
80-
sed -i 's/variables_order.*/variables_order = \"EGPCS\"/g' /etc/php/7.4/apache2/php.ini
79+
sed -i 's|;include_path = ".:/usr/share/php"|include_path = ".:/usr/share/php:/data/pear"|g' /etc/php/8.3/apache2/php.ini
80+
sed -i 's/variables_order.*/variables_order = \"EGPCS\"/g' /etc/php/8.3/apache2/php.ini
8181
sed -i 's/IncludeOptional sites-enabled\/\*.conf/IncludeOptional \/data\/apache2\/sites-enabled\/*.conf/' /etc/apache2/apache2.conf
82-
sed -i 's|;error_log = php_errors.log|error_log = /data/apache2/logs/error_log|g' /etc/php/7.4/apache2/php.ini
83-
echo "extension=mcrypt.so" > /etc/php/7.4/apache2/conf.d/mcrypt.ini
82+
sed -i 's|;error_log = php_errors.log|error_log = /data/apache2/logs/error_log|g' /etc/php/8.3/apache2/php.ini
83+
echo "extension=mcrypt.so" > /etc/php/8.3/apache2/conf.d/mcrypt.ini
8484

8585
# Setup Redis
86-
echo "extension=redis.so" > /etc/php/7.4/mods-available/redis.ini
87-
ln -sf /etc/php/7.4/mods-available/redis.ini /etc/php/7.4/cli/conf.d/20-redis.ini
88-
ln -sf /etc/php/7.4/mods-available/redis.ini /etc/php/7.4/apache2/conf.d/20-redis.ini
86+
echo "extension=redis.so" > /etc/php/8.3/mods-available/redis.ini
87+
ln -sf /etc/php/8.3/mods-available/redis.ini /etc/php/8.3/cli/conf.d/20-redis.ini
88+
ln -sf /etc/php/8.3/mods-available/redis.ini /etc/php/8.3/apache2/conf.d/20-redis.ini
8989

9090
# Update the PHP.ini file, enable <? ?> tags
91-
sed -i 's|short_open_tag = Off|short_open_tag = On|g' /etc/php/7.4/apache2/php.ini
91+
sed -i 's|short_open_tag = Off|short_open_tag = On|g' /etc/php/8.3/apache2/php.ini
9292

9393
# Sessions & garbage collection
94-
sed -i 's|;session.save_path = "/var/lib/php5"|session.save_path = "/tmp"|g' /etc/php/7.4/apache2/php.ini
95-
sed -i 's|session.gc_probability = 0|session.gc_probability = 1|g' /etc/php/7.4/apache2/php.ini
94+
sed -i 's|;session.save_path = "/var/lib/php5"|session.save_path = "/tmp"|g' /etc/php/8.3/apache2/php.ini
95+
sed -i 's|session.gc_probability = 0|session.gc_probability = 1|g' /etc/php/8.3/apache2/php.ini
9696

9797
# Update Apache / PHP Config
98-
sed -i 's|max_execution_time = 30|max_execution_time = 300|g' /etc/php/7.4/apache2/php.ini
99-
sed -i 's|memory_limit = 128M|memory_limit = -1|g' /etc/php/7.4/apache2/php.ini
100-
sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 1000M|g' /etc/php/7.4/apache2/php.ini
101-
sed -i 's|post_max_size = 8M|post_max_size = 1000M|g' /etc/php/7.4/apache2/php.ini
102-
sed -i 's|max_input_time = 60|max_input_time = 300|g' /etc/php/7.4/apache2/php.ini
98+
sed -i 's|max_execution_time = 30|max_execution_time = 300|g' /etc/php/8.3/apache2/php.ini
99+
sed -i 's|memory_limit = 128M|memory_limit = -1|g' /etc/php/8.3/apache2/php.ini
100+
sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 1000M|g' /etc/php/8.3/apache2/php.ini
101+
sed -i 's|post_max_size = 8M|post_max_size = 1000M|g' /etc/php/8.3/apache2/php.ini
102+
sed -i 's|max_input_time = 60|max_input_time = 300|g' /etc/php/8.3/apache2/php.ini
103103

104104
# Update CLI Config
105-
sed -i 's|memory_limit = 128M|memory_limit = -1|g' /etc/php/7.4/cli/php.ini
106-
sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 1000M|g' /etc/php/7.4/cli/php.ini
107-
sed -i 's|post_max_size = 8M|post_max_size = 1000M|g' /etc/php/7.4/cli/php.ini
105+
sed -i 's|memory_limit = 128M|memory_limit = -1|g' /etc/php/8.3/cli/php.ini
106+
sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 1000M|g' /etc/php/8.3/cli/php.ini
107+
sed -i 's|post_max_size = 8M|post_max_size = 1000M|g' /etc/php/8.3/cli/php.ini
108108

109109

110110
# Add build file to remove duplicate script execution
111-
echo 1 > /etc/php/7.4/apache2/build
111+
echo 1 > /etc/php/8.3/apache2/build
112112

113113
if [[ -z "${NODE_ENVIRONMENT}" ]]; then
114114
# $NODE_ENVIRONMENT is set on container creation
115115
echo " env NODE_ENVIRONMENT is not set, Apache is not configured correctly."
116116
else
117117
if [ "$NODE_ENVIRONMENT" == 'dev' ]; then
118118
# Tweak Apache build
119-
sed -i 's|\[PHP\]|\[PHP\] \nIS_LIVE=0 \nIS_DEV=1 \nNODE_ENVIRONMENT=dev \n;The IS_DEV is set for testing outside of DEV environments ie: test.domain.tld|g' /etc/php/7.4/apache2/php.ini
119+
sed -i 's|\[PHP\]|\[PHP\] \nIS_LIVE=0 \nIS_DEV=1 \nNODE_ENVIRONMENT=dev \n;The IS_DEV is set for testing outside of DEV environments ie: test.domain.tld|g' /etc/php/8.3/apache2/php.ini
120120
# Log errors into log files
121-
sed -i 's/error_reporting = .*$/error_reporting = E_ALL/' /etc/php/7.4/apache2/php.ini
121+
sed -i 's/error_reporting = .*$/error_reporting = E_ALL/' /etc/php/8.3/apache2/php.ini
122122
# Default is 1024 and 0 allows to not apply any maximum length at all
123-
sed -i 's|log_errors_max_len = 1024|log_errors_max_len = 0|g' /etc/php/7.4/apache2/php.ini
123+
sed -i 's|log_errors_max_len = 1024|log_errors_max_len = 0|g' /etc/php/8.3/apache2/php.ini
124124
fi
125125

126126
if [ "$NODE_ENVIRONMENT" == 'production' ]; then
127127
# Tweak Apache build
128-
sed -i 's|\[PHP\]|\[PHP\] \nIS_LIVE=1 \nIS_DEV=0 \nNODE_ENVIRONMENT=production \n;The IS_DEV is set for testing outside of DEV environments ie: test.domain.tld|g' /etc/php/7.4/apache2/php.ini
128+
sed -i 's|\[PHP\]|\[PHP\] \nIS_LIVE=1 \nIS_DEV=0 \nNODE_ENVIRONMENT=production \n;The IS_DEV is set for testing outside of DEV environments ie: test.domain.tld|g' /etc/php/8.3/apache2/php.ini
129129
# Log errors into log files
130-
sed -i 's/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/' /etc/php/7.4/apache2/php.ini
130+
sed -i 's/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/' /etc/php/8.3/apache2/php.ini
131131
fi
132132

133133
fi

tests/build_tests.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ testCLI_max_input_time()
135135

136136
testApache_max_execution_time()
137137
{
138-
max_execution_time=$(cat /etc/php/7.4/apache2/php.ini | grep 'max_execution_time')
138+
max_execution_time=$(cat /etc/php/8.3/apache2/php.ini | grep 'max_execution_time')
139139
echo 'Test max_execution_time, currently set to "'$max_execution_time'"'
140140
test=$(echo $max_execution_time | grep 'max_execution_time = 300' | wc -l)
141141
assertEquals 1 $test
@@ -144,7 +144,7 @@ testApache_max_execution_time()
144144

145145
testApache_MemoryLimit()
146146
{
147-
memory_limit=$(cat /etc/php/7.4/apache2/php.ini | grep 'memory_limit')
147+
memory_limit=$(cat /etc/php/8.3/apache2/php.ini | grep 'memory_limit')
148148
echo 'Test memory_limit, currently set to "'$memory_limit'"'
149149
test=$(echo $memory_limit | grep 'memory_limit = -1' | wc -l)
150150
assertEquals 1 $test
@@ -153,7 +153,7 @@ testApache_MemoryLimit()
153153

154154
testApache_upload_max_filesize()
155155
{
156-
upload_max_filesize=$(cat /etc/php/7.4/apache2/php.ini | grep 'upload_max_filesize')
156+
upload_max_filesize=$(cat /etc/php/8.3/apache2/php.ini | grep 'upload_max_filesize')
157157
echo 'Test upload_max_filesize, currently set to "'$upload_max_filesize'"'
158158
test=$(echo $upload_max_filesize | grep 'upload_max_filesize = 1000M' | wc -l)
159159
assertEquals 1 $test
@@ -162,7 +162,7 @@ testApache_upload_max_filesize()
162162

163163
testApache_post_max_size()
164164
{
165-
post_max_size=$(cat /etc/php/7.4/apache2/php.ini | grep 'post_max_size')
165+
post_max_size=$(cat /etc/php/8.3/apache2/php.ini | grep 'post_max_size')
166166
echo 'Test post_max_size, currently set to "'$post_max_size'"'
167167
test=$(echo $post_max_size | grep 'post_max_size = 1000M' | wc -l)
168168
assertEquals 1 $test
@@ -171,7 +171,7 @@ testApache_post_max_size()
171171

172172
testApache_max_input_time()
173173
{
174-
max_input_time=$(cat /etc/php/7.4/apache2/php.ini | grep 'max_input_time')
174+
max_input_time=$(cat /etc/php/8.3/apache2/php.ini | grep 'max_input_time')
175175
echo 'Test max_input_time, currently set to "'$max_input_time'"'
176176
test=$(echo $max_input_time | grep 'max_input_time = 300' | wc -l)
177177
assertEquals 1 $test

0 commit comments

Comments
 (0)