Skip to content

Commit 1ead73a

Browse files
committed
Release 7.2.0 - See CHANGELOG.md
1 parent f42fc2c commit 1ead73a

File tree

4 files changed

+50
-28
lines changed

4 files changed

+50
-28
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 7.2.0 2022-10-13 <dave at tiredofit dot ca>
2+
3+
### Added
4+
- Introduce customizable Opcache and APC environment variables
5+
6+
17
## 7.1.1 2022-10-05 <dave at tiredofit dot ca>
28

39
### Changed

README.md

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -181,32 +181,36 @@ When `PHP_FPM_CONTAINER_MODE` set to `nginx` the `PHP_FPM_LISTEN_PORT` environme
181181

182182
*You can also pass arguments to each server as defined in the [Nginx Upstream Documentation](https://nginx.org/en/docs/http/ngx_http_upstream_module.html)*
183183

184-
| Parameter | Description | Default |
185-
| ---------------------------- | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
186-
| `PHP_APC_SHM_SIZE` | APC Cache Memory size - `0` to disable | `128M` |
187-
| `PHP_FPM_HOST` | Default PHP-FPM Host, seperate multiple by commas | `127.0.0.1:9000` - See above Container options |
188-
| `PHP_FPM_LISTEN_PORT` | PHP-FPM Listening Port - Ignored with above container options | `9000` |
189-
| `PHP_FPM_MAX_CHILDREN` | Maximum Children | `75` |
190-
| `PHP_FPM_MAX_REQUESTS` | How many requests before spawning new server | `500` |
191-
| `PHP_FPM_MAX_SPARE_SERVERS` | Maximum Spare Servers available | `3` |
192-
| `PHP_FPM_MIN_SPARE_SERVERS` | Minium Spare Servers avaialble | `1` |
193-
| `PHP_FPM_OUTPUT_BUFFER_SIZE` | Output buffer size in bytes | `0` |
194-
| `PHP_FPM_POST_INIT_COMMAND` | If you wish to execute a command before php-fpm executes, enter it here and seperate multiples by comma. | |
195-
| `PHP_FPM_POST_INIT_SCRIPT` | If you wish to execute a script before php-fpm executes, enter it here and seperate multiples by comma. | |
196-
| `PHP_FPM_PROCESS_MANAGER` | How to handle processes `static`, `ondemand`, `dynamic` | `dynamic` |
197-
| `PHP_FPM_START_SERVERS` | How many FPM servers to start initially | `2` |
198-
| `PHP_LOG_ACCESS_FILE` | PHP Access Logfile Name | `access.log` |
199-
| `PHP_LOG_ERROR_FILE` | Logfile name | `error.log` |
200-
| `PHP_LOG_LEVEL` | PHP Log Level `alert` `error` `warning` `notice` `debug` | `notice` |
201-
| `PHP_LOG_ACCESS_FORMAT` | Log format - `default` or `json` | `default` |
202-
| `PHP_LOG_LIMIT` | Characters to log | `2048` |
203-
| `PHP_LOG_LOCATION` | Log Location for PHP Logs | `/www/logs/php-fpm` |
204-
| `PHP_MEMORY_LIMIT` | How much memory should PHP use | `128M` |
205-
| `PHP_OPCACHE_MEM_SIZE` | OPCache Memory Size - Set `0` to disable or via other env vars | `128` |
206-
| `PHP_POST_MAX_SIZE` | Maximum Input Size for POST | `2G` |
207-
| `PHP_TIMEOUT` | Maximum Script execution Time | `180` |
208-
| `PHP_UPLOAD_MAX_SIZE` | Maximum Input Size for Uploads | `2G` |
209-
| `PHP_WEBROOT` | Used with `CONTAINER_MODE=php-fpm` | `/www/html` |
184+
| Parameter | Description | Default |
185+
| ------------------------------------- | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
186+
| `PHP_APC_SHM_SIZE` | APC Cache Memory size - `0` to disable | `128M` |
187+
| `PHP_APC_TTL` | APC Time to live in seconds | `7200` |
188+
| `PHP_FPM_HOST` | Default PHP-FPM Host, seperate multiple by commas | `127.0.0.1:9000` - See above Container options |
189+
| `PHP_FPM_LISTEN_PORT` | PHP-FPM Listening Port - Ignored with above container options | `9000` |
190+
| `PHP_FPM_MAX_CHILDREN` | Maximum Children | `75` |
191+
| `PHP_FPM_MAX_REQUESTS` | How many requests before spawning new server | `500` |
192+
| `PHP_FPM_MAX_SPARE_SERVERS` | Maximum Spare Servers available | `3` |
193+
| `PHP_FPM_MIN_SPARE_SERVERS` | Minium Spare Servers avaialble | `1` |
194+
| `PHP_FPM_OUTPUT_BUFFER_SIZE` | Output buffer size in bytes | `0` |
195+
| `PHP_FPM_POST_INIT_COMMAND` | If you wish to execute a command before php-fpm executes, enter it here and seperate multiples by comma. | |
196+
| `PHP_FPM_POST_INIT_SCRIPT` | If you wish to execute a script before php-fpm executes, enter it here and seperate multiples by comma. | |
197+
| `PHP_FPM_PROCESS_MANAGER` | How to handle processes `static`, `ondemand`, `dynamic` | `dynamic` |
198+
| `PHP_FPM_START_SERVERS` | How many FPM servers to start initially | `2` |
199+
| `PHP_LOG_ACCESS_FILE` | PHP Access Logfile Name | `access.log` |
200+
| `PHP_LOG_ERROR_FILE` | Logfile name | `error.log` |
201+
| `PHP_LOG_LEVEL` | PHP Log Level `alert` `error` `warning` `notice` `debug` | `notice` |
202+
| `PHP_LOG_ACCESS_FORMAT` | Log format - `default` or `json` | `default` |
203+
| `PHP_LOG_LIMIT` | Characters to log | `2048` |
204+
| `PHP_LOG_LOCATION` | Log Location for PHP Logs | `/www/logs/php-fpm` |
205+
| `PHP_MEMORY_LIMIT` | How much memory should PHP use | `128M` |
206+
| `PHP_OPCACHE_INTERNED_STRINGS_BUFFER` | OPCache interned strings buffer | `16` |
207+
| `PHP_OPCACHE_MAX_ACCELERATED_FILES` | OPCache Max accelerated files | `5413` |
208+
| `PHP_OPCACHE_MEM_SIZE` | OPCache Memory Size - Set `0` to disable or via other env vars | `128` |
209+
| `PHP_OPCACHE_REVALIDATE_FREQ` | OPCache revalidate frequency | `60` |
210+
| `PHP_POST_MAX_SIZE` | Maximum Input Size for POST | `2G` |
211+
| `PHP_TIMEOUT` | Maximum Script execution Time | `180` |
212+
| `PHP_UPLOAD_MAX_SIZE` | Maximum Input Size for Uploads | `2G` |
213+
| `PHP_WEBROOT` | Used with `CONTAINER_MODE=php-fpm` | `/www/html` |
210214

211215
#### Enabling / Disabling Specific Extensions
212216

install/assets/defaults/20-php-fpm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Set Defaults
44
ENABLE_PHP_FPM=${ENABLE_PHP_FPM:-"TRUE"}
55
PHP_APC_SHM_SIZE=${PHP_APC_SHM_SIZE:-"128M"}
6+
PHP_APC_TTL=${PHP_APC_TTL:-"7200"}
67
PHP_FPM_CONTAINER_MODE=${PHP_FPM_CONTAINER_MODE:-"nginx-php-fpm"}
78
PHP_DISPLAY_ERRORS=${PHP_DISPLAY_ERRORS:-"TRUE"}
89
PHP_ENABLE_CREATE_SAMPLE_PHP=${PHP_ENABLE_CREATE_SAMPLE_PHP:-"TRUE"}
@@ -23,7 +24,10 @@ PHP_LOG_LEVEL=${PHP_LOG_LEVEL:-"notice"}
2324
PHP_LOG_LIMIT=${PHP_LOG_LIMIT:-"3072"}
2425
PHP_LOG_LOCATION=${PHP_LOG_LOCATION:-"/www/logs/php-fpm"}
2526
PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT:-"128M"}
27+
PHP_OPCACHE_INTERNED_STRINGS_BUFFER=${PHP_OPCACHE_INTERNED_STRINGS_BUFFER:-"16"}
28+
PHP_OPCACHE_MAX_ACCELERATED_FILES=${PHP_OPCACHE_MAX_ACCELERATED_FILES:-"5413"}
2629
PHP_OPCACHE_MEM_SIZE=${PHP_OPCACHE_MEM_SIZE:-"128"}
30+
PHP_OPCACHE_REVALIDATE_FREQ=${PHP_OPCACHE_REVALIDATE_FREQ:-"60"}
2731
PHP_POST_MAX_SIZE=${PHP_POST_MAX_SIZE:-"2G"}
2832
PHP_TIMEOUT=${PHP_TIMEOUT:-"180"}
2933
PHP_UPLOAD_MAX_SIZE=${PHP_UPLOAD_MAX_SIZE:-"2G"}

install/assets/functions/20-php-fpm

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,16 @@ phpfpm_configure_server() {
217217

218218
update_template /etc/nginx/snippets/php-fpm.conf PHP_TIMEOUT
219219

220-
sed -i "s#apc.shm_size.*#apc.shm_size=${PHP_APC_SHM_SIZE}#g" /assets/php-fpm//mods-available/apcu.ini
221-
sed -i "s#opcache.memory_consumption.*#opcache.memory_consumption=$PHP_OPCACHE_MEM_SIZE#g" /assets/php-fpm/mods-available/opcache.ini
220+
sed -i -e "s#apc.shm_size=.*#apc.shm_size=${PHP_APC_SHM_SIZE}#g" \
221+
-e "s#apc.ttl=.*#apc.ttl=${PHP_APC_TTL}#g" \
222+
/assets/php-fpm//mods-available/apcu.ini
223+
224+
sed -i -e "s#opcache.memory_consumption=.*#opcache.memory_consumption=${PHP_OPCACHE_MEM_SIZE}#g" \
225+
-e "s#opcache.interned_strings_buffer=.*#opcache.interned_strings_buffer=${PHP_OPCACHE_INTERNED_STRINGS_BUFFER}#g" \
226+
-e "s#opcache.max_accelerated_files=.*#max_accelerated_files=${PHP_OPCACHE_MAX_ACCELERATED_FILES}#g" \
227+
-e "s#opcache.revalidate_freq=.*#revalidate_freq=${PHP_OPCACHE_REVALIDATE_FREQ}#g" \
228+
/assets/php-fpm/mods-available/opcache.ini
229+
222230
sed -i -e "s#memory_limit = .*#memory_limit = ${PHP_MEMORY_LIMIT}#g" \
223231
-e "s#max_input_time = .*#max_input_time = ${PHP_TIMEOUT}#g" \
224232
-e "s#default_socket_timeout = .*#default_socket_timeout = ${PHP_TIMEOUT}#g" \

0 commit comments

Comments
 (0)