# PHP files should be handled by PHP, and should be preferred over any other file type
RUN{\
echo'<FilesMatch \.php$>';\
echo'\tSetHandler application/x-httpd-php';\
echo'</FilesMatch>';\
echo;\
echo'DirectoryIndex disabled';\
echo'DirectoryIndex index.php index.html';\
echo;\
echo'<Directory /var/www/>';\
echo'\tOptions -Indexes';\
echo'\tAllowOverride All';\
echo'</Directory>';\
}| tee "$APACHE_CONFDIR/conf-available/docker-php.conf"\
&& a2enconf docker-php
ENV PHP_EXTRA_BUILD_DEPS apache2-dev
ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2
##</autogenerated>##
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
# Enable optimization (-O2)
# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default)
# Adds GNU HASH segments to generated executables (this is used if present, and is much faster than sysv hash; in this configuration, sysv hash is also generated)
# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236)
--enable-ftp \
# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195)
--enable-mbstring \
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
--enable-mysqlnd \
\
--with-curl \
--with-libedit \
--with-openssl \
--with-zlib \
\
# bundled pcre is too old for s390x (which isn't exactly a good sign)