-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Comments
You shouldn't set relative paths. |
@taylorotwell should we not update the default all to wrap the env variable in a call to database_path or something? |
how would you declare |
That's a problem too. Not sure how we fix this. :/ |
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
'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'
The text was updated successfully, but these errors were encountered: