mirror of
https://github.com/devilbox/docker-php-fpm.git
synced 2025-12-11 11:31:16 +00:00
PHP 5.2 Adjustments
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
<section name="pool">
|
||||
|
||||
Name of pool. Used in logs and stats.
|
||||
<value name="name">default</value>
|
||||
<value name="name">www</value>
|
||||
|
||||
Address to accept fastcgi requests on.
|
||||
Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket'
|
||||
@@ -50,6 +50,16 @@
|
||||
</value>
|
||||
|
||||
Additional php.ini defines, specific to this pool of workers.
|
||||
<value name="php_defines">
|
||||
<value name="error_reporting">6135</value>
|
||||
<value name="xmlrpc_errors">0</value>
|
||||
<value name="report_memleaks">1</value>
|
||||
<value name="display_errors">0</value>
|
||||
<value name="display_startup_errors">0</value>
|
||||
<value name="track_errors">1</value>
|
||||
<value name="log_errors">1</value>
|
||||
<value name="html_errors">0</value>
|
||||
</value>
|
||||
|
||||
Unix user of processes
|
||||
<value name="user">devilbox</value>
|
||||
@@ -68,21 +78,25 @@
|
||||
Equivalent to Apache MaxClients directive.
|
||||
Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi
|
||||
Used with any pm_style.
|
||||
<value name="max_children">50</value>
|
||||
<!--<value name="max_children">50</value>-->
|
||||
<value name="max_children">5</value>
|
||||
|
||||
Settings group for 'apache-like' pm style
|
||||
<value name="apache_like">
|
||||
Sets the number of server processes created on startup.
|
||||
Used only when 'apache-like' pm_style is selected
|
||||
<value name="StartServers">4</value>
|
||||
<!--<value name="StartServers">4</value>-->
|
||||
<value name="StartServers">3</value>
|
||||
|
||||
Sets the desired minimum number of idle server processes.
|
||||
Used only when 'apache-like' pm_style is selected
|
||||
<!--<value name="MinSpareServers">2</value>-->
|
||||
<value name="MinSpareServers">2</value>
|
||||
|
||||
Sets the desired maximum number of idle server processes.
|
||||
Used only when 'apache-like' pm_style is selected
|
||||
<value name="MaxSpareServers">6</value>
|
||||
<!--<value name="MaxSpareServers">6</value>-->
|
||||
<value name="MaxSpareServers">4</value>
|
||||
</value>
|
||||
|
||||
</value>
|
||||
@@ -97,7 +111,7 @@
|
||||
<value name="request_slowlog_timeout">0s</value>
|
||||
|
||||
The log file for slow requests
|
||||
<value name="slowlog">logs/slow.log</value>
|
||||
<value name="slowlog">/proc/self/fd/2</value>
|
||||
|
||||
Set open file desc rlimit
|
||||
<value name="rlimit_files">1024</value>
|
||||
|
||||
@@ -33,6 +33,22 @@ copy_fpm_files() {
|
||||
run "find ${fpm_dst} -type f -iname '*.conf' -exec chmod 0644 \"{}\" \;" "${debug}"
|
||||
}
|
||||
|
||||
###
|
||||
### Copy php-fpm.conf for PHP 5.2
|
||||
### Note: PHP 5.2 does not allow includes and comes in XML format,
|
||||
### we must therefore copy the file to its main file /usr/local/etc/php-fpm.conf
|
||||
###
|
||||
copy_fpm_5_2_conf_file() {
|
||||
local fpm_src="${1}"
|
||||
local fpm_dst="/usr/local/etc/php-fpm.conf"
|
||||
local debug="${2}"
|
||||
|
||||
if [ -f "${fpm_src}" ]; then
|
||||
log "info" "PHP-FPM.conf (PHP 5.2): php-fpm.xml -> ${fpm_dst}" "${debug}"
|
||||
run "cp ${fpm_src} ${fpm_dst}" "${debug}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
############################################################
|
||||
# Sanity Checks
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# PHP FPM 5.3 does not allow to pass through environment variables
|
||||
# PHP FPM 5.2 and PHP-FPM 5.3 do not allow to pass through environment variables
|
||||
# This is a hacky shell script to create:
|
||||
# env[NAME]='VALUE' entries for PHP FPM config out of all current env vars
|
||||
|
||||
|
||||
@@ -80,9 +80,9 @@ set_timezone "TIMEZONE" "${PHP_INI_DIR}" "${DEBUG_LEVEL}"
|
||||
|
||||
|
||||
###
|
||||
### PHP-FPM 5.3 Env variables
|
||||
### PHP-FPM 5.2 and PHP-FPM 5.3 Env variables fix
|
||||
###
|
||||
if php -v 2>/dev/null | grep -Eoq '^PHP[[:space:]]5\.3'; then
|
||||
if php -v 2>/dev/null | grep -Eoq '^PHP[[:space:]]5\.(2|3)'; then
|
||||
set_env_php_fpm "/usr/local/etc/php-fpm.d/env.conf"
|
||||
fi
|
||||
|
||||
@@ -159,7 +159,11 @@ copy_ini_files "${PHP_CUST_INI_DIR}" "${PHP_INI_DIR}" "${DEBUG_LEVEL}"
|
||||
###
|
||||
### Copy custom PHP-FPM *.conf files
|
||||
###
|
||||
copy_fpm_files "${PHP_CUST_FPM_DIR}" "${PHP_FPM_DIR}" "${DEBUG_LEVEL}"
|
||||
if [ "${PHP_VERSION}" = "5.2" ]; then
|
||||
copy_fpm_5_2_conf_file "${PHP_CUST_FPM_DIR}/php-fpm.xml" "${DEBUG_LEVEL}"
|
||||
else
|
||||
copy_fpm_files "${PHP_CUST_FPM_DIR}" "${PHP_FPM_DIR}" "${DEBUG_LEVEL}"
|
||||
fi
|
||||
|
||||
|
||||
###
|
||||
|
||||
@@ -65,6 +65,7 @@ RUN set -x \
|
||||
libc-dev \
|
||||
libffi-dev\
|
||||
libssl-dev\
|
||||
libyaml-dev \
|
||||
make \
|
||||
mongodb-org-shell \
|
||||
mongodb-org-tools \
|
||||
|
||||
@@ -65,6 +65,7 @@ RUN set -x \
|
||||
libc-dev \
|
||||
libffi-dev\
|
||||
libssl-dev\
|
||||
libyaml-dev \
|
||||
make \
|
||||
mongodb-org-shell \
|
||||
mongodb-org-tools \
|
||||
|
||||
@@ -65,6 +65,7 @@ RUN set -x \
|
||||
libc-dev \
|
||||
libffi-dev\
|
||||
libssl-dev\
|
||||
libyaml-dev \
|
||||
make \
|
||||
mongodb-org-shell \
|
||||
mongodb-org-tools \
|
||||
|
||||
@@ -65,6 +65,7 @@ RUN set -x \
|
||||
libc-dev \
|
||||
libffi-dev\
|
||||
libssl-dev\
|
||||
libyaml-dev \
|
||||
make \
|
||||
mongodb-org-shell \
|
||||
mongodb-org-tools \
|
||||
|
||||
@@ -65,6 +65,7 @@ RUN set -x \
|
||||
libc-dev \
|
||||
libffi-dev\
|
||||
libssl-dev\
|
||||
libyaml-dev \
|
||||
make \
|
||||
mongodb-org-shell \
|
||||
mongodb-org-tools \
|
||||
|
||||
@@ -65,6 +65,7 @@ RUN set -x \
|
||||
libc-dev \
|
||||
libffi-dev\
|
||||
libssl-dev\
|
||||
libyaml-dev \
|
||||
make \
|
||||
mongodb-org-shell \
|
||||
mongodb-org-tools \
|
||||
|
||||
@@ -65,6 +65,7 @@ RUN set -x \
|
||||
libc-dev \
|
||||
libffi-dev\
|
||||
libssl-dev\
|
||||
libyaml-dev \
|
||||
make \
|
||||
mongodb-org-shell \
|
||||
mongodb-org-tools \
|
||||
|
||||
@@ -65,6 +65,7 @@ RUN set -x \
|
||||
libc-dev \
|
||||
libffi-dev\
|
||||
libssl-dev\
|
||||
libyaml-dev \
|
||||
make \
|
||||
mongodb-org-shell \
|
||||
mongodb-org-tools \
|
||||
|
||||
@@ -65,6 +65,7 @@ RUN set -x \
|
||||
libc-dev \
|
||||
libffi-dev\
|
||||
libssl-dev\
|
||||
libyaml-dev \
|
||||
make \
|
||||
mongodb-org-shell \
|
||||
mongodb-org-tools \
|
||||
|
||||
@@ -80,9 +80,9 @@ set_timezone "TIMEZONE" "${PHP_INI_DIR}" "${DEBUG_LEVEL}"
|
||||
|
||||
|
||||
###
|
||||
### PHP-FPM 5.3 Env variables
|
||||
### PHP-FPM 5.2 and PHP-FPM 5.3 Env variables fix
|
||||
###
|
||||
if php -v 2>/dev/null | grep -Eoq '^PHP[[:space:]]5\.3'; then
|
||||
if php -v 2>/dev/null | grep -Eoq '^PHP[[:space:]]5\.(2|3)'; then
|
||||
set_env_php_fpm "/usr/local/etc/php-fpm.d/env.conf"
|
||||
fi
|
||||
|
||||
@@ -159,7 +159,11 @@ copy_ini_files "${PHP_CUST_INI_DIR}" "${PHP_INI_DIR}" "${DEBUG_LEVEL}"
|
||||
###
|
||||
### Copy custom PHP-FPM *.conf files
|
||||
###
|
||||
if [ "${PHP_VERSION}" = "5.2" ]; then
|
||||
copy_fpm_5_2_conf_file "${PHP_CUST_FPM_DIR}/php-fpm.xml" "${DEBUG_LEVEL}"
|
||||
else
|
||||
copy_fpm_files "${PHP_CUST_FPM_DIR}" "${PHP_FPM_DIR}" "${DEBUG_LEVEL}"
|
||||
fi
|
||||
|
||||
|
||||
###
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<section name="pool">
|
||||
|
||||
Name of pool. Used in logs and stats.
|
||||
<value name="name">default</value>
|
||||
<value name="name">www</value>
|
||||
|
||||
Address to accept fastcgi requests on.
|
||||
Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket'
|
||||
@@ -50,6 +50,16 @@
|
||||
</value>
|
||||
|
||||
Additional php.ini defines, specific to this pool of workers.
|
||||
<value name="php_defines">
|
||||
<value name="error_reporting">-1</value>
|
||||
<value name="xmlrpc_errors">0</value>
|
||||
<value name="report_memleaks">1</value>
|
||||
<value name="display_errors">1</value>
|
||||
<value name="display_startup_errors">1</value>
|
||||
<value name="track_errors">1</value>
|
||||
<value name="log_errors">1</value>
|
||||
<value name="html_errors">1</value>
|
||||
</value>
|
||||
|
||||
Unix user of processes
|
||||
<value name="user">devilbox</value>
|
||||
@@ -68,21 +78,25 @@
|
||||
Equivalent to Apache MaxClients directive.
|
||||
Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi
|
||||
Used with any pm_style.
|
||||
<value name="max_children">50</value>
|
||||
<!--<value name="max_children">50</value>-->
|
||||
<value name="max_children">5</value>
|
||||
|
||||
Settings group for 'apache-like' pm style
|
||||
<value name="apache_like">
|
||||
Sets the number of server processes created on startup.
|
||||
Used only when 'apache-like' pm_style is selected
|
||||
<value name="StartServers">4</value>
|
||||
<!--<value name="StartServers">4</value>-->
|
||||
<value name="StartServers">3</value>
|
||||
|
||||
Sets the desired minimum number of idle server processes.
|
||||
Used only when 'apache-like' pm_style is selected
|
||||
<!--<value name="MinSpareServers">2</value>-->
|
||||
<value name="MinSpareServers">2</value>
|
||||
|
||||
Sets the desired maximum number of idle server processes.
|
||||
Used only when 'apache-like' pm_style is selected
|
||||
<value name="MaxSpareServers">6</value>
|
||||
<!--<value name="MaxSpareServers">6</value>-->
|
||||
<value name="MaxSpareServers">4</value>
|
||||
</value>
|
||||
|
||||
</value>
|
||||
@@ -97,7 +111,7 @@
|
||||
<value name="request_slowlog_timeout">0s</value>
|
||||
|
||||
The log file for slow requests
|
||||
<value name="slowlog">logs/slow.log</value>
|
||||
<value name="slowlog">/proc/self/fd/2</value>
|
||||
|
||||
Set open file desc rlimit
|
||||
<value name="rlimit_files">1024</value>
|
||||
|
||||
@@ -160,7 +160,7 @@ listen.backlog = {{ item.cfg[item.key].listen_backlog | default(item.cfg[item.al
|
||||
<section name="pool">
|
||||
|
||||
Name of pool. Used in logs and stats.
|
||||
<value name="name">default</value>
|
||||
<value name="name">www</value>
|
||||
|
||||
Address to accept fastcgi requests on.
|
||||
Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket'
|
||||
@@ -178,6 +178,16 @@ listen.backlog = {{ item.cfg[item.key].listen_backlog | default(item.cfg[item.al
|
||||
</value>
|
||||
|
||||
Additional php.ini defines, specific to this pool of workers.
|
||||
<value name="php_defines">
|
||||
<value name="error_reporting">{% if item.key == 'base' %}6135{% else %}-1{% endif %}</value>
|
||||
<value name="xmlrpc_errors">0</value>
|
||||
<value name="report_memleaks">1</value>
|
||||
<value name="display_errors">{% if item.key == 'base' %}0{% else %}1{% endif %}</value>
|
||||
<value name="display_startup_errors">{% if item.key == 'base' %}0{% else %}1{% endif %}</value>
|
||||
<value name="track_errors">1</value>
|
||||
<value name="log_errors">1</value>
|
||||
<value name="html_errors">{% if item.key == 'base' %}0{% else %}1{% endif %}</value>
|
||||
</value>
|
||||
|
||||
Unix user of processes
|
||||
<value name="user">{{ item.cfg[item.key].user | default(item.cfg[item.alt].user) }}</value>
|
||||
@@ -196,21 +206,25 @@ listen.backlog = {{ item.cfg[item.key].listen_backlog | default(item.cfg[item.al
|
||||
Equivalent to Apache MaxClients directive.
|
||||
Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi
|
||||
Used with any pm_style.
|
||||
<value name="max_children">{{ item.cfg[item.key].pm_max_children | default(item.cfg[item.alt].pm_max_children) }}</value>
|
||||
<!--<value name="max_children">{{ item.cfg[item.key].pm_max_children | default(item.cfg[item.alt].pm_max_children) }}</value>-->
|
||||
<value name="max_children">5</value>
|
||||
|
||||
Settings group for 'apache-like' pm style
|
||||
<value name="apache_like">
|
||||
Sets the number of server processes created on startup.
|
||||
Used only when 'apache-like' pm_style is selected
|
||||
<value name="StartServers">{{ item.cfg[item.key].pm_start_servers | default(item.cfg[item.alt].pm_start_servers) }}</value>
|
||||
<!--<value name="StartServers">{{ item.cfg[item.key].pm_start_servers | default(item.cfg[item.alt].pm_start_servers) }}</value>-->
|
||||
<value name="StartServers">3</value>
|
||||
|
||||
Sets the desired minimum number of idle server processes.
|
||||
Used only when 'apache-like' pm_style is selected
|
||||
<value name="MinSpareServers">{{ item.cfg[item.key].pm_min_spare_servers | default(item.cfg[item.alt].pm_min_spare_servers) }}</value>
|
||||
<!--<value name="MinSpareServers">{{ item.cfg[item.key].pm_min_spare_servers | default(item.cfg[item.alt].pm_min_spare_servers) }}</value>-->
|
||||
<value name="MinSpareServers">2</value>
|
||||
|
||||
Sets the desired maximum number of idle server processes.
|
||||
Used only when 'apache-like' pm_style is selected
|
||||
<value name="MaxSpareServers">{{ item.cfg[item.key].pm_max_spare_servers | default(item.cfg[item.alt].pm_max_spare_servers) }}</value>
|
||||
<!--<value name="MaxSpareServers">{{ item.cfg[item.key].pm_max_spare_servers | default(item.cfg[item.alt].pm_max_spare_servers) }}</value>-->
|
||||
<value name="MaxSpareServers">4</value>
|
||||
</value>
|
||||
|
||||
</value>
|
||||
@@ -225,7 +239,7 @@ listen.backlog = {{ item.cfg[item.key].listen_backlog | default(item.cfg[item.al
|
||||
<value name="request_slowlog_timeout">0s</value>
|
||||
|
||||
The log file for slow requests
|
||||
<value name="slowlog">logs/slow.log</value>
|
||||
<value name="slowlog">{{ item.cfg[item.key].error_log | default(item.cfg[item.alt].error_log) }}</value>
|
||||
|
||||
Set open file desc rlimit
|
||||
<value name="rlimit_files">1024</value>
|
||||
|
||||
@@ -80,6 +80,7 @@ RUN set -x \
|
||||
libc-dev \
|
||||
libffi-dev\
|
||||
libssl-dev\
|
||||
libyaml-dev \
|
||||
make \
|
||||
mongodb-org-shell \
|
||||
mongodb-org-tools \
|
||||
|
||||
Reference in New Issue
Block a user