File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ LABEL \
1010# ##
1111# ## Build arguments
1212# ##
13- ARG VHOST_GEN_GIT_REF=0.10
13+ ARG VHOST_GEN_GIT_REF=0.11
1414ARG CERT_GEN_GIT_REF=0.2
1515
1616ENV BUILD_DEPS \
Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ This Docker container adds a lot of injectables in order to customize it to your
127127| PHP_FPM_ENABLE | bool | ` 0 ` | Enable PHP-FPM for the default vhost and the mass virtual hosts. |
128128| PHP_FPM_SERVER_ADDR | string | `` | IP address or hostname of remote PHP-FPM server.<br /><strong >Required when enabling PHP.</strong > |
129129| PHP_FPM_SERVER_PORT | int | ` 9000 ` | Port of remote PHP-FPM server |
130+ | COMPAT | str | - | Set this value to ` 5.2 ` to enable PHP-FPM 5.2 compatbility mode. (Only when using PHP-FPM 5.2) |
130131
131132##### Optional environmental variables (default vhost)
132133
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -e
4+ set -u
5+ set -o pipefail
6+
7+
8+ # ###########################################################
9+ # Functions
10+ # ###########################################################
11+
12+ # ##
13+ # ## Ensure COMPAT is set
14+ # ##
15+ export_php_fpm_compat () {
16+ local varname=" ${1} "
17+ local debug=" ${2} "
18+ local value=" 0"
19+
20+ if ! env_set " ${varname} " ; then
21+ log " info" " \$ ${varname} not set. Not enabling PHP 5.2 compatibility mode." " ${debug} "
22+ # Ensure variable is exported
23+ eval " export ${varname} =0"
24+ else
25+ value=" $( env_get " ${varname} " ) "
26+ if [ " ${value} " = " 5.2" ]; then
27+ log " info" " PHP 5.2 compatibility mode: Enabled" " ${debug} "
28+ # Ensure variable is exported
29+ eval " export ${varname} =1"
30+ else
31+ log " info" " PHP 5.2 compatibility mode: Disabled" " ${debug} "
32+ # Ensure variable is exported
33+ eval " export ${varname} =0"
34+ fi
35+ fi
36+ }
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ export_docker_logs "DOCKER_LOGS" "${DEBUG_LEVEL}"
7979# ##
8080# ## Ensure PHP-FPM variables are exported
8181# ##
82+ export_php_fpm_compat " COMPAT" " ${DEBUG_LEVEL} "
8283export_php_fpm_enable " PHP_FPM_ENABLE" " ${DEBUG_LEVEL} "
8384export_php_fpm_server_addr " PHP_FPM_SERVER_ADDR" " ${DEBUG_LEVEL} "
8485export_php_fpm_server_port " PHP_FPM_SERVER_PORT" " ${DEBUG_LEVEL} "
122123# # vhost-gen Configuration
123124# ############################################################
124125
126+ # ##
127+ # ## Ensure PHP 5.2 conmpat mode is applied
128+ # ##
129+ if [ " ${COMPAT} " = " 1" ]; then
130+ # Replace current value 'FPM' with 'GENERIC'
131+ log " info" " Setting PHP 5.2 compat mode" " ${DEBUG_LEVEL} "
132+ sed -i' ' ' s|\(ProxyFCGIBackendType\).*$|\1 GENERIC|g' /etc/vhost-gen/templates/apache24.yml
133+ else
134+ log " info" " Disabling PHP 5.2 compat mode" " ${DEBUG_LEVEL} "
135+ fi
136+
125137# ##
126138# ## Enable and configure PHP-FPM
127139# ##
You can’t perform that action at this time.
0 commit comments