skip to Main Content

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.

Root of site

2

Answers


  1. You probably defined the APP_STORAGE in your .env file to D: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).

    Login or Signup to reply.
  2. 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:

    php artisan storage:link
    

    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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search