Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kabamgamer's avatar

Laravel failed to open stream: no such file in directory

Can please someone help me with this error? I get this error after I deployed my laravel on an online server. I'm with this error for over a week right now and I just can't fix it! Can please someone help me?

The error is shown on my domain: https://lankhaardesign.nl/

I already tried the "php artisan config:cache" and "php artisan cache:clear", but none of them worked for me. I've also already made a symlink, so it has nothing to do with storache permission either. The exactly same laravel project is running in my local environment and there are no problems at all! I already changed the .env so that's not the problem either.

I just can't find it. I did not hardcode anything. I'm 100% sure about that. I NEVER do that and I already searched with atom for "C:" but it's nowhere to find in the buffer...

Can please someone fix this with me? I can't solve this problem on my own.

0 likes
5 replies
ottoszika's avatar

I see you are using "file" as session driver. Your application is deployed on a Linux server, but you have a Windows-like path set. Please verify your config/session.php file. I think you hardcoded your storage path. Default value for path (if it helps) is:

...
'files' => storage_path('framework/sessions'),
...
kabamgamer's avatar

@ottoszika , The value is already 'files' => storage_path('framework/sessions'), So as it turns out, thats neither the problem.

ottoszika's avatar
Level 7

Maybe it's cached in bootstrap/cache/config.php. Try: php artisan config:clear.

3 likes

Please or to participate in this conversation.