After looking/comparing at the output of `./configure` for our i386 and amd64 builds against that of Debian's i386 build, our i386 build was the only one of the three to include `checking whether to force non-PIC code in shared modules... yes` (the other two were `no`).
Debian includes `--with-pic`, and we do not.
Looking at the upstream PHP code for this configure check (313a56add0/configure.ac (L241-L256)), this makes total sense, and explains why i386 is the only architecture we see this issue on:
```m4
dnl Disable PIC mode by default where it is known to be safe to do so, to avoid
dnl the performance hit from the lost register.
AC_MSG_CHECKING([whether to force non-PIC code in shared modules])
case $host_alias in
i?86-*-linux*|i?86-*-freebsd*)
if test "${with_pic+set}" != "set" || test "$with_pic" = "no"; then
with_pic=no
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
;;
*)
AC_MSG_RESULT(no)
;;
esac
```
This was probably already implied by our `CFLAGS` (and the compiler) on Alpine, but I figured it doesn't hurt to be explicit / consistent.
These are the URLs listed on https://www.php.net/downloads (and the URLs Homebrew is using), so they seem more appropriate/correct than these older URLs we've been using.
It turns out that --hash-style=gnu is considered better than either of --hash-style=both or --hash-style=sysv, assuming your environment/platform supports it.
On amd64 with both Debian's and Alpine's linkers, --hash-style=gnu is the default.
This is especially relevant on MIPS (mips64le), where "ld: .gnu.hash is incompatible with the MIPS ABI" (so the linker sanely defaults to --hash-style=sysv there, as it should).
The default signal used by docker to stop a container is SIGTERM and
that signal is understood by PHP-FPM as immediate termination.
This means that `php-fpm` won't wait for in-flight requests to finish
before of stopping the workers and main process. This behaviour is quite
undesired for production environments and should be avoided as much as
possible.
This implementation is meant to be extremely simple and only address the
stop signal used when running `docker stop`. `php-fpm` signal choices
are somewhat peculiar (`SIGUSR2` for example) and if we want to "fix"
them we would have to use a tool (e.g.: `dumb-init`).
More info:
- https://linux.die.net/man/8/php-fpm
- https://docs.docker.com/engine/reference/builder/#stopsignal
- https://github.com/Yelp/dumb-init
- https://github.com/usabilla/php-docker-template/pull/102