Apache shows PHP code if .php in URL is not lowercase
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
Research direction
Start with apache-Dockerfile-block-1 at the referenced configuration section and inspect how it creates /etc/apache2/conf-enabled/docker-php.conf. Update the PHP filename matching so mixed- or uppercase .php URLs use the PHP handler, then verify behavior for lowercase, mixed-case, and uppercase extensions in the affected Apache image.
Written by the indexing model from the issue text.
Description
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
</FilesMatch>
To fix it, FilesMatch's regexp should be case-insensitive:
<FilesMatch \.(?i:php)$>
SetHandler application/x-httpd-php
</FilesMatch>
I can make a pull request but should the change be made in this file? https://github.com/docker-library/php/blob/a80762e229981b94c9fe6c381637350e9104096a/apache-Dockerfile-block-1#L45
- Dominant language
- Dockerfile
- Stars
- 4k
- Forks
- 2k
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from docker-library/php
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
docker-library/php#1674 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
docker-library/php#1680 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
docker-library/php#1675 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
docker-library/php#1673 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
docker-library/php#1631 · 9 comments · 6 reactions ·
All issues in docker-library/php
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
stratum-mining/stratum#2404 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Diaoul/subliminal#1382 ·
-
fix(errors): EHOSTUNREACH from a happy-eyeballs connect is reported as a resolver error (STAMP-80) Open
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
snapshot-labs/stamp#666 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
GauravKarakoti/SecureFlow#1070 · 1 comment ·
-
triage/confirmed
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
agentscope-ai/agentscope#2775 ·