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

inconsistent 'base' directory between 'artisan migrate' and 'artisan serve' #13243

Closed
oprudkyi opened this issue Apr 21, 2016 · 5 comments
Closed

Comments

@oprudkyi
Copy link

'artisan migrate' and 'artisan serve' uses different root directories ('serve' chroots into public)
as result, use of relative paths in .env doesn't work
i.e., for example
DB_DATABASE=storage/database/local.sqlite

works for 'artisan migrate' and doesn't work for 'artisan serve'

@GrahamCampbell
Copy link
Member

You shouldn't set relative paths.

@GrahamCampbell
Copy link
Member

@taylorotwell should we not update the default all to wrap the env variable in a call to database_path or something?

@crynobone
Copy link
Member

how would you declare :memory: then?

@GrahamCampbell
Copy link
Member

GrahamCampbell commented Apr 21, 2016

That's a problem too. Not sure how we fix this. :/

@oprudkyi
Copy link
Author

probably (as from consistency point) , 'artisan migrate' should do chdir as well

LukeTowers added a commit to wintercms/winter that referenced this issue Oct 30, 2024
When using a mirrored public folder (i.e. `artisan winter:mirror public`), the working directory for the request is set to base_path('public') instead of base_path(), so it is important to use absolute paths when calling File::exists() as it internally just calls file_exists(), which uses the current working directory to resolve relative paths.

Related:
- wintercms/storm@752c162#diff-58c1a5c5e22fc25e75bb02e4af9d2085cfe66b8cfe7c3cffc2f32a4fb60240aaR31
- laravel/framework#45679
- laravel/framework#13243
bennothommo pushed a commit to wintercms/wn-system-module that referenced this issue Oct 30, 2024
When using a mirrored public folder (i.e. `artisan winter:mirror public`), the working directory for the request is set to base_path('public') instead of base_path(), so it is important to use absolute paths when calling File::exists() as it internally just calls file_exists(), which uses the current working directory to resolve relative paths.

Related:
- wintercms/storm@752c162#diff-58c1a5c5e22fc25e75bb02e4af9d2085cfe66b8cfe7c3cffc2f32a4fb60240aaR31
- laravel/framework#45679
- laravel/framework#13243
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants