-
Notifications
You must be signed in to change notification settings - Fork 491
Expand file tree
/
Copy path10-php.sh
More file actions
24 lines (20 loc) · 937 Bytes
/
10-php.sh
File metadata and controls
24 lines (20 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
PHP_VERSION=$(php -r 'echo phpversion();' | cut -d '-' -f 1)
# Configure php-fpm
go-replace --mode=lineinfile --regex \
-s '^[\s;]*access.format[\s]*=' -r 'access.format = "%R - %u %t \"%m %r%Q%q\" %s %f cpu:%C%% mem:%{megabytes}M reqTime:%d"' \
-- /opt/docker/etc/php/fpm/pool.d/application.conf
if [[ "$(version-compare "$PHP_VERSION" "5.5.999")" == "<" ]]; then
# listen on public IPv4 port
# no ipv6 sockets available for old php version
go-replace --mode=line --regex \
-s '^[\s;]*listen[\s]*=' -r 'listen = 0.0.0.0:9000' \
-- /opt/docker/etc/php/fpm/pool.d/application.conf \
/opt/docker/etc/php/fpm/php-fpm.conf
else
# listen on public IPv6 port
go-replace --mode=line --regex \
-s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \
-- /opt/docker/etc/php/fpm/pool.d/application.conf \
/opt/docker/etc/php/fpm/php-fpm.conf
fi