php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75183 When accessing with / at the end of uri with extension,source code is displayed
Submitted: 2017-09-11 09:56 UTC Modified: 2017-11-05 04:22 UTC
From: noreply at example dot com Assigned:
Status: No Feedback Package: Built-in web server
PHP Version: 7.2.0RC1 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
30 + 30 = ?
Subscribe to this entry?

 
 [2017-09-11 09:56 UTC] noreply at example dot com
Description:
------------
When accessing with / at the end of uri with extension,
PHP source code is displayed.

BUG in PHP build-in server : PHP 7.2, 7.1 ,7.0
(There is no bug in PHP 5.x)

  (1) php -S localhost:8080

  (2) curl "http://localhost:8080/index.php/"


Test script:
---------------
<?php
// index.php
echo PHP_VERSION;

Expected result:
----------------
The PHP script is executed.

Actual result:
--------------
PHP source code is displayed.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-11 10:11 UTC] kelunik@php.net
I can't reproduce this with PHP 7.2beta2.
 [2017-09-11 10:12 UTC] kelunik@php.net
-Status: Open +Status: Feedback
 [2017-09-12 13:17 UTC] noreply at example dot com
php -S localhost:8080
PHP 7.2.0RC1 Development Server started at Tue Sep 12 22:10:09 2017
Listening on http://localhost:8080
Document root is 
Press Ctrl-C to quit.
[Tue Sep 12 22:10:17 2017] ::1:58304 [200]: /
[Tue Sep 12 22:10:25 2017] ::1:58305 [200]: /index.php
[Tue Sep 12 22:10:29 2017] ::1:58306 [200]: /index.php/


$ curl "http://localhost:8080/"
7.2.0RC1 : ok

$ curl "http://localhost:8080/index.php"
7.2.0RC1 : ok

$ curl "http://localhost:8080/index.php/"
<?php
echo PHP_VERSION . " : ok";
 [2017-09-12 13:42 UTC] kelunik@php.net
This might be a Windows related issue, it's not reproducible on Linux.

cu┌[kelunik@kelunik] - [~] - [15:38:41] - []
└[8301] $ curl "http://localhost:8080/"
7.2.0RC1: ok
┌[kelunik@kelunik] - [~] - [15:38:48] - []
└[8302] $ curl "http://localhost:8080/index.php"
7.2.0RC1: ok
┌[kelunik@kelunik] - [~] - [15:38:52] - []
└[8303] $ curl "http://localhost:8080/index.php/"
7.2.0RC1: ok
 [2017-09-13 10:12 UTC] ab@php.net
I don't reproduce this on Windows as well :( Please check the environment, especially that there's no other programs running on the same port, etc.

Thanks.
 [2017-11-05 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Jan 24 21:03:34 2022 UTC