Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apache shows PHP code if .php in URL is not lowercase #1421

Closed
nizar787 opened this issue Jun 23, 2023 · 1 comment
Closed

Apache shows PHP code if .php in URL is not lowercase #1421

nizar787 opened this issue Jun 23, 2023 · 1 comment

Comments

@nizar787
Copy link

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$>'; \

@tianon
Copy link
Member

tianon commented Jun 23, 2023

Duplicate of #973 👀

@tianon tianon closed this as completed Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants