{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/16352","labels_url":"https://api.github.com/repos/symfony/symfony/issues/16352/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/16352/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/16352/events","html_url":"https://github.com/symfony/symfony/pull/16352","id":113606964,"number":16352,"title":"Fix the server variables in the router_dev.php file","user":{"login":"leofeyer","id":1192057,"avatar_url":"https://avatars.githubusercontent.com/u/1192057?v=3","gravatar_id":"","url":"https://api.github.com/users/leofeyer","html_url":"https://github.com/leofeyer","followers_url":"https://api.github.com/users/leofeyer/followers","following_url":"https://api.github.com/users/leofeyer/following{/other_user}","gists_url":"https://api.github.com/users/leofeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/leofeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leofeyer/subscriptions","organizations_url":"https://api.github.com/users/leofeyer/orgs","repos_url":"https://api.github.com/users/leofeyer/repos","events_url":"https://api.github.com/users/leofeyer/events{/privacy}","received_events_url":"https://api.github.com/users/leofeyer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/symfony/symfony/labels/Status:%20Needs%20Review","name":"Status: Needs Review","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-27T15:10:02Z","updated_at":"2015-10-27T15:31:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/16352","html_url":"https://github.com/symfony/symfony/pull/16352","diff_url":"https://github.com/symfony/symfony/pull/16352.diff","patch_url":"https://github.com/symfony/symfony/pull/16352.patch"},"body":"| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | yes\r\n| New feature?  | no\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | none\r\n| License       | MIT\r\n\r\nThe built-in web server automatically rewrites everything to the `app_dev.php` script, but it does not adjust the server variables accordingly.\r\n\r\nHere is the output of `print_r($_SERVER)` on Apache with mod_rewrite enabled (relevant lines only):\r\n\r\n```\r\nArray\r\n(\r\n    [REQUEST_URI] => /text-elements.html\r\n    [SCRIPT_NAME] => /app_dev.php\r\n    [PHP_SELF] => /app_dev.php\r\n)\r\n```\r\n\r\nAnd here is the output of the exact same script on the built-in server:\r\n\r\n```\r\nArray\r\n(\r\n    [REQUEST_URI] => /text-elements.html\r\n    [SCRIPT_NAME] => /text-elements.html\r\n    [PHP_SELF] => /text-elements.html\r\n)\r\n```\r\n\r\nAnd here is the return value of Symfony's `Request::getScriptName()` method:\r\n\r\n```php\r\n// Apache: http://localhost/text-elements.html\r\necho $this->container->get('request_stack')->getCurrentRequest()->getScriptName(); // /app_dev.php\r\n\r\n// Built-in web server: http://127.0.0.1:8000/text-elements.html\r\necho $this->container->get('request_stack')->getCurrentRequest()->getScriptName(); // /text-elements.html\r\n```\r\n\r\nThis PR fixes the two server variables in the `router_dev.php` script."},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/151542102","html_url":"https://github.com/symfony/symfony/pull/16352#issuecomment-151542102","issue_url":"https://api.github.com/repos/symfony/symfony/issues/16352","id":151542102,"user":{"login":"leofeyer","id":1192057,"avatar_url":"https://avatars.githubusercontent.com/u/1192057?v=3","gravatar_id":"","url":"https://api.github.com/users/leofeyer","html_url":"https://github.com/leofeyer","followers_url":"https://api.github.com/users/leofeyer/followers","following_url":"https://api.github.com/users/leofeyer/following{/other_user}","gists_url":"https://api.github.com/users/leofeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/leofeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leofeyer/subscriptions","organizations_url":"https://api.github.com/users/leofeyer/orgs","repos_url":"https://api.github.com/users/leofeyer/repos","events_url":"https://api.github.com/users/leofeyer/events{/privacy}","received_events_url":"https://api.github.com/users/leofeyer/received_events","type":"User","site_admin":false},"created_at":"2015-10-27T15:31:37Z","updated_at":"2015-10-27T15:31:37Z","body":"You are right. I have updated the PR."}}