If you enter a URL in browser pointing to a PHP file and .php at the end is not all lowercase (e.g. .phP, .pHp, .PHP, like example.com/index.PHP), Apache shows content of the PHP file.
This is because of this config in /etc/apache2/conf-enabled/docker-php.conf:
If you enter a URL in browser pointing to a PHP file and .php at the end is not all lowercase (e.g. .phP, .pHp, .PHP, like example.com/index.PHP), Apache shows content of the PHP file. This is because of this config in /etc/apache2/conf-enabled/docker-php.conf:
<FilesMatch .php$> SetHandler application/x-httpd-php
To fix it, FilesMatch's regexp should be case-insensitive:
<FilesMatch .(?i:php)$> SetHandler application/x-httpd-php I can make a pull request but should the change be made in this file?
php/apache-Dockerfile-block-1
Line 45 in a80762e
echo '<FilesMatch .php$>'; \