Session error in launching laravel application

[Website URL]

(http://maki-mada.great-site.net)

Error Message

file_put_contents(D:\Projet\maki-mada-back\storage\framework/sessions/lNsY2fssah2ohLMDSugVaOcJHAg9k60ODnvTOeQ2): Failed to open stream: No such file or directory

Other Information

I have a free account and I use laravel.

Locally, everything works but when I tried on the server, I encountered this error.
I really need help

This is more than just obvious: you throw your local path here, so of course it works locally and not here.

I’m not familiar with laravel but it isn’t a good practise to hardcode document roots.

5 Likes

I think the issue here is caused by Laravel’s configuration cache. The base configuration files are good by default, and Laravel will use paths that are relative to where the project is set up.

However, to avoid having to look up all the configuration for every request, Laravel caches the configuration of your site, which includes having full paths to the storage directory.

To fix this, simply delete the file cache/bootstrap/config.php file.

5 Likes

this is the solution, thank you very much

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.