Kinda having a weird problem here. I am using laragon as my local dev app and now I am testing my code on a shared hosting. The thing is, the laravel.log file puts itself and recreates itself in the /public folder if I delete it. I have absolutely no clue why.
It doesn’t behave that way locally, only on the host.
Edit 1:
I am running Windows 10 and webhost is on Debian / Linux 8.11
Edit 2:
When I run a search in my vs code project, I only get two results for the indicated path.
One in the root of the project laravel.log and one in the storage/logs folder. The same file name.
2
Answers
You probably defined the
APP_STORAGE
in your .env file toD:laragonXXXXXX
.You can comment out (using "#") that configuration variable and create a storage directory on the website root (at the same level of public directory).
It seems that its related to symbolic link which can be different in windows and Linux. You can read more here. As is shown in question link is created in windows, as an absolute path, which doesn’t exist on Linux. One workaround would be to use relative paths in config/filesystems.php.
But the correct way is to include symbolic links in gitignore. Then in deployment you must run:
to generate them according to the OS. You can add that command in composer.json , scripts->post-autoload-dump.
UPDATE
Laragon doesn’t create an isolated environment like docker does. So when Laravel caches the config, it resolves the paths according to windows absolute path( here it’s D:laragonwww… ). As is mentioned in comments this Laravel app is moved to host using ftp without caching config on host. So host is using the same cache as windows.