115
115
fi
116
116
117
117
if [ "${PHP_OPCACHE_MEM_SIZE}" = "0" ] || var_false "${PHP_ENABLE_OPCACHE}" ; then
118
- sed -i -e "s/opcache.enable=1/opcache.enable=0/g" /assets/php-fpm/mods-available/opcache.ini
119
- sed -i -e "s/opcache.enable_cli=1/opcache.enable_cli=0/g" /assets/php-fpm/mods-available/opcache.ini
118
+ sed -i \
119
+ -e "s/opcache.enable=1/opcache.enable=0/g" \
120
+ -e "s/opcache.enable_cli=1/opcache.enable_cli=0/g" \
121
+ /assets/php-fpm/mods-available/opcache.ini
120
122
else
121
123
if var_true "${CONTAINER_ENABLE_MONITORING}" && [ "${CONTAINER_MONITORING_BACKEND,,}" = "zabbix" ]; then
122
124
source /assets/defaults/03-monitoring
@@ -191,8 +193,10 @@ phpfpm_configure_nginx() {
191
193
done
192
194
echo "}" >> /etc/nginx/snippets/php-fpm-upstream.conf
193
195
194
- sed -i -e "/# Do not delete - Upstream Configuration/a\ \ \ \ include \/etc\/nginx\/snippets\/php-fpm-upstream.conf;" /etc/nginx/nginx.conf
195
- sed -i -e "/# Do not delete - Upstream Configuration/a\ \ \ \ ### PHP-FPM Multiple Handlers configuration" /etc/nginx/nginx.conf
196
+ sed -i \
197
+ -e "/# Do not delete - Upstream Configuration/a\ \ \ \ include \/etc\/nginx\/snippets\/php-fpm-upstream.conf;" \
198
+ -e "/# Do not delete - Upstream Configuration/a\ \ \ \ ### PHP-FPM Multiple Handlers configuration" \
199
+ /etc/nginx/nginx.conf
196
200
}
197
201
198
202
phpfpm_configure_server() {
@@ -223,21 +227,33 @@ phpfpm_configure_server() {
223
227
224
228
update_template /etc/nginx/snippets/php-fpm.conf PHP_TIMEOUT
225
229
226
- sed -i -e "s#apc.shm_size=.*#apc.shm_size=${PHP_APC_SHM_SIZE}#g" \
227
- -e "s#apc.ttl=.*#apc.ttl=${PHP_APC_TTL}#g" \
230
+ sed -i \
231
+ -e "s#apc.shm_size=.*#apc.shm_size=${PHP_APC_SHM_SIZE}#g" \
232
+ -e "s#apc.ttl=.*#apc.ttl=${PHP_APC_TTL}#g" \
228
233
/assets/php-fpm//mods-available/apcu.ini
229
234
230
- sed -i -e "s#opcache.memory_consumption=.*#opcache.memory_consumption=${PHP_OPCACHE_MEM_SIZE}#g" \
231
- -e "s#opcache.interned_strings_buffer=.*#opcache.interned_strings_buffer=${PHP_OPCACHE_INTERNED_STRINGS_BUFFER}#g" \
232
- -e "s#opcache.max_accelerated_files=.*#max_accelerated_files=${PHP_OPCACHE_MAX_ACCELERATED_FILES}#g" \
233
- -e "s#opcache.revalidate_freq=.*#revalidate_freq=${PHP_OPCACHE_REVALIDATE_FREQ}#g" \
235
+ sed -i \
236
+ -e "s#opcache.memory_consumption=.*#opcache.memory_consumption=${PHP_OPCACHE_MEM_SIZE}#g" \
237
+ -e "s#opcache.interned_strings_buffer=.*#opcache.interned_strings_buffer=${PHP_OPCACHE_INTERNED_STRINGS_BUFFER}#g" \
238
+ -e "s#opcache.max_accelerated_files=.*#max_accelerated_files=${PHP_OPCACHE_MAX_ACCELERATED_FILES}#g" \
239
+ -e "s#opcache.revalidate_freq=.*#revalidate_freq=${PHP_OPCACHE_REVALIDATE_FREQ}#g"
234
240
/assets/php-fpm/mods-available/opcache.ini
235
241
236
- sed -i -e "s#memory_limit = .*#memory_limit = ${PHP_MEMORY_LIMIT}#g" \
237
- -e "s#max_input_time = .*#max_input_time = ${PHP_TIMEOUT}#g" \
238
- -e "s#default_socket_timeout = .*#default_socket_timeout = ${PHP_TIMEOUT}#g" \
239
- -e "s#post_max_size = .*#post_max_size = ${PHP_UPLOAD_MAX_SIZE}#g" \
240
- -e "s#upload_max_filesize = .*#upload_max_filesize = ${PHP_UPLOAD_MAX_SIZE}#g" \
242
+ if [ "${PHP_BASE:0:1}" = "7" ] ; then
243
+ sed -i "/opcache.jit/d" /assets/php-fpm/mods-available/opcache.ini
244
+ else
245
+ sed -i \
246
+ -e "s#opcache.jit_buffer_size=.*#opcache.jit_buffer_size=${PHP_OPCACHE_JIT_BUFFER_SIZE}#g" \
247
+ -e "s#opcache.jit=.*#opcache.jit=${PHP_OPCACHE_JIT_MODE}#g"
248
+ /assets/php-fpm/mods-available/opcache.ini
249
+ fi
250
+
251
+ sed -i \
252
+ -e "s#memory_limit = .*#memory_limit = ${PHP_MEMORY_LIMIT}#g" \
253
+ -e "s#max_input_time = .*#max_input_time = ${PHP_TIMEOUT}#g" \
254
+ -e "s#default_socket_timeout = .*#default_socket_timeout = ${PHP_TIMEOUT}#g" \
255
+ -e "s#post_max_size = .*#post_max_size = ${PHP_UPLOAD_MAX_SIZE}#g" \
256
+ -e "s#upload_max_filesize = .*#upload_max_filesize = ${PHP_UPLOAD_MAX_SIZE}#g" \
241
257
/assets/php-fpm/cli/php.ini
242
258
243
259
if [ -n "${PHP_IDE_CONFIG}" ]; then
@@ -248,9 +264,9 @@ phpfpm_configure_server() {
248
264
fi
249
265
fi
250
266
251
- sed -i -e "s#date.timezone = .*#date.timezone = $(cat /etc/timezone)#g" /assets/php-fpm/cli/php.ini
252
- sed -i -e "s#date.timezone = .*#date.timezone = $(cat /etc/timezone)#g" /assets/php-fpm/fpm/php.ini
267
+ sed -i -e "s#date.timezone = .*#date.timezone = $(cat /etc/timezone)#g" /assets/php-fpm/cli/php.ini /assets/php-fpm/fpm/php.ini
253
268
}
269
+
254
270
phpfpm_create_default_page() {
255
271
if var_true "${php_enable_create_sample_php}" ; then
256
272
if [ ! -f "${NGINX_WEBROOT}"/index.php ] ; then
0 commit comments