Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Fix error 404 if not run Lumen in root #21

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Apr 15, 2015

getPathInfo() give wrong uri if Lumen run in a sub folder, this PR to resolve the problem.

Previous PR, i have missing a case that if uri contains a path like sub-folder name
@ghost ghost closed this Apr 16, 2015
@ghost ghost reopened this Apr 16, 2015
@ghost ghost changed the title fix error 404 if not run Lumen in root [fixed] Fix error 404 if not run Lumen in root Apr 16, 2015
@@ -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']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

folder?

Copy link
Author

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 /

@GrahamCampbell
Copy link
Member

Oh, right, I see. You can't run Lumen in a subfolder.

@ghost
Copy link
Author

ghost commented Apr 16, 2015

So then will this fixed ?

@GrahamCampbell
Copy link
Member

It's not going to be fixed. It's not supported.

@ghost
Copy link
Author

ghost commented Apr 16, 2015

👎 people must run lumen in root domain.
What about if i have used laravel in root domain, and want to use lumen in http://domain/api/ ?
don't tell me that i must setup api.domain for it to use.

@GrahamCampbell
Copy link
Member

@ptcong That is also true for Laravel.

@ghost
Copy link
Author

ghost commented Apr 16, 2015

With laravel and all other framework i have used, i can run in subfolder as well.

@GrahamCampbell
Copy link
Member

We don't encourage it in Laravel, and we pretend you can't in the docs.

@laravel laravel locked and limited conversation to collaborators Apr 16, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant