Page MenuHomePhabricator

MediaWiki PHP based built-in server does not output log requests for index.php queries
Closed, ResolvedPublic

Description

When using the PHP built-in webserver with maintenance/dev/start.sh, requests made to regular files do show in the console output but requests to .php files do not log anything in the console. It is a bit annoying since one is left wondering whether the requests are actually honored.

The reason is the request router maintenance/dev/includes/router.php does a require of the PHP file and abort the router (return true):

55 $ext = pathinfo( $file, PATHINFO_EXTENSION );
56 if ( $ext == 'php' || $ext == 'php5' ) {
57     # Execute php files
58     # We use require and return true here because when you return false
59     # the php webserver will discard post data and things like login
60     # will not function in the dev environment.
# Execute the php file
61     require $file;
62 
# abort
63     return true;
64 }

That causes the built-in php server to not produce the access log requests. Based on the note, some earlier PHP version had POST data stripped preventing login. It works with php7.0 at least.

The reason seems to be PHP #60159 Router returns false, but POST is not passed to requested resource. Which was in 5.4 beta and got fixed in the final release 5.4.0.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 23 2018, 10:38 AM
hashar updated the task description. (Show Details)Mar 23 2018, 10:40 AM
hashar updated the task description. (Show Details)

+ shipyard, I would like to use the PHP built-in server for the CI Qunit jobs at least.

Change 421500 had a related patch set uploaded (by Hashar; owner: Hashar):
[mediawiki/core@master] Let built-in web server handle .php requests

https://gerrit.wikimedia.org/r/421500

hashar updated the task description. (Show Details)Mar 28 2018, 1:30 PM
hashar closed this task as Resolved.Mar 28 2018, 1:37 PM
hashar claimed this task.

Change 421500 merged by jenkins-bot:
[mediawiki/core@master] Let built-in web server handle .php requests

https://gerrit.wikimedia.org/r/421500

Change 425010 had a related patch set uploaded (by Hashar; owner: Hashar):
[mediawiki/core@REL1_30] Let built-in web server handle .php requests

https://gerrit.wikimedia.org/r/425010

Change 425010 merged by jenkins-bot:
[mediawiki/core@REL1_30] Let built-in web server handle .php requests

https://gerrit.wikimedia.org/r/425010

Change 425129 had a related patch set uploaded (by Hashar; owner: Hashar):
[mediawiki/core@REL1_29] Let built-in web server handle .php requests

https://gerrit.wikimedia.org/r/425129

Change 425129 merged by jenkins-bot:
[mediawiki/core@REL1_29] Let built-in web server handle .php requests

https://gerrit.wikimedia.org/r/425129