-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix error 404 if not run Lumen in root #21
Conversation
Previous PR, i have missing a case that if uri contains a path like sub-folder name
@@ -1324,8 +1324,12 @@ protected function getMethod() | |||
public function getPathInfo() | |||
{ | |||
$query = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : ''; | |||
|
|||
return '/'.ltrim(str_replace('?'.$query, '', $_SERVER['REQUEST_URI']), '/'); | |||
$folder = dirname($_SERVER['SCRIPT_NAME']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya, if i run lumen in http://localhost/folder/folder/ then the $folder is /folder/folder
If run in root domain, the $folder is /
Oh, right, I see. You can't run Lumen in a subfolder. |
So then will this fixed ? |
It's not going to be fixed. It's not supported. |
👎 people must run lumen in root domain. |
@ptcong That is also true for Laravel. |
With laravel and all other framework i have used, i can run in subfolder as well. |
We don't encourage it in Laravel, and we pretend you can't in the docs. |
getPathInfo()
give wrong uri if Lumen run in a sub folder, this PR to resolve the problem.