Skip to content

Commit 84baa34

Browse files
committed
Reconfigure the PHP Handler to be conditional on file existence
Set the handler to use for files whose extension ends in `.php`. This is a workaround for docker-library/php#1576 The `FallbackResource` is a default Handler action which is only used if a Handler has not already been applied. The docker/php image sets the handler unconditionally for any file whose name matches `.php`. This configuration block unsets the default handler, and instead only applies it if the file exists.
1 parent 76962d0 commit 84baa34

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

assets/web/apache2_faildumps.conf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,15 @@
77
</Location>
88

99
Alias /_/faildumps /var/www/behatfaildumps
10+
11+
# Set the handler to use for files whose extension ends in `.php`.
12+
# This is a workaround for https://github.com/docker-library/php/issues/1576
13+
# The FallbackResource is a default Handler action which is only used if a Handler has not already been applied.
14+
# The docker/php image sets the handler unconditionally for any file whose name matches `.php`.
15+
# This configuration block unsets the default handler, and instead only applies it if the file exists.
16+
<FilesMatch \.php$>
17+
SetHandler none
18+
<If "-f %{REQUEST_FILENAME}">
19+
SetHandler application/x-httpd-php
20+
</If>
21+
</FilesMatch>

0 commit comments

Comments
 (0)