|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74061 Built-in server assumes path with dot is a file
Submitted: 2017-02-08 14:06 UTC Modified: 2023-02-13 18:22 UTC
Avg. Score:4.1 ± 0.9
Reproduced:6 of 6 (100.0%)
Same Version:1 (16.7%)
Same OS:2 (33.3%)
From: aljosha dot papsch at vinexus dot eu Assigned:
Status: Duplicate Package: Built-in web server
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: aljosha dot papsch at vinexus dot eu
New email:
PHP Version: OS:


 [2017-02-08 14:06 UTC] aljosha dot papsch at vinexus dot eu
If the path contains a dot, built-in server assumes it's a file and tries to serve it. Try the test script with the following URLs. Last one will return 404 response but should route to index.php.

$ curl http://localhost:8000/
$ curl http://localhost:8000/O_o
$ curl http://localhost:8000/O.o

Test script:
echo "hello, world\n";

Expected result:
hello, world

Actual result:
<!doctype html><html><head><title>404 Not Found</title><style>
body { background-color: #fcfcfc; color: #333333; margin: 0; padding:0; }
h1 { font-size: 1.5em; font-weight: normal; background-color: #9999cc; min-height:2em; line-height:2em; border-bottom: 1px inset black; margin: 0; }
h1, p { padding-left: 10px; }
code.url { background-color: #eeeeee; font-family:monospace; padding:0 2px;}
</head><body><h1>Not Found</h1><p>The requested resource <code class="url">/ba.z</code> was not found on this server.</p></body></html>


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-03-04 17:20 UTC]
Should have check for this bug..

So duplicate of #74205, fixed by
 [2023-02-13 18:22 UTC]
-Status: Open +Status: Duplicate
 [2023-02-13 18:22 UTC]
Closed in favor of
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Oct 02 17:01:25 2023 UTC