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

OshJones's avatar

file_put_contents error on deploy

Hi all,

I've never had this issue before but i get this error when I try and get my site live. It all works fine on XAMPP locally.

Any help will be greatly appreciated.

Running Laravel 5.5

PHP 7.0 running on server.

I can see it's still trying to look in my xampp folder instead of on the actual server. Any ideas on where to change this

file_put_contents(C:\xampp\htdocs\template\storage\framework/sessions/H88urfV9i5pugcdyiTgmFp02OaIhKQ7FcGFxrJIJ): failed to open stream: No such file or directory

0 likes
11 replies
36864's avatar

You need to create the storage/framework directory manually.

You might need to create the whole /storage/ directory structure manually:

storage/app
storage/logs
storage/framework
storage/framework/cache
storage/framework/sessions
storage/framework/views
storage/framework/testing
2 likes
bashy's avatar

Have you defined that path somewhere? Is it a Linux server?

OshJones's avatar

the storage folder is already there. with 3 subfolders of app, framework and logs.

OshJones's avatar

@bashy I haven't defined that path anywhere that I can remember. It is a Linux server yeah, which means the slashes are the wrong way round wherever it's defined right?

Got an hour commute home now, will have a look when I'm home again.

Thanks in advance for any help

Saikishore's avatar
Level 2

@OshJones Please check the below possibilities to resolve the issue what I know.

First try with this command in live

 php artisan cache:clear

If the above not worked, recheck the new folders below ...

storage/framework/cache
storage/framework/sessions
storage/framework/views

still you are not getting the solution, check the storage or framework permissions.

chmod -R gu+w storage

chmod -R guo+w storage
6 likes
36864's avatar

It's not just the slashes, it looks like you've defined an absolute storage path that was valid on your development machine but obviously won't be valid on a linux server.

This might just be a caching issue, if you copy/pasted the project folder directly into your server, try clearing the cache.

OshJones's avatar

Thanks guys, turns out it was an issue with the cache due to copy pasting the files over. Bit of a headache, but all fixed now.

Thank you all for your help.

OshJones's avatar

@arctushar It was a case of running php composer update and making sure it was loading the image intervention class from the config file.

pankajPrabhakar's avatar

getting the same issue and checked storage dir and everything was fine there, getting the issue because of php versions, on xampp its 8.2 and on server its linux server 7.4, so make php versions same and update composer

Please or to participate in this conversation.