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

initech's avatar
Level 10

Issues with Vapor

laravel vapor everything is a readonly file system?

In Filesystem.php line 122:

  file_put_contents(/var/task/database/migrations/2019_09_17_224613_create_se
  ssions_table.php): failed to open stream: Read-only file system

0 likes
4 replies
Snapey's avatar
Snapey
Best Answer
Level 122

yes, thats correct. There is no local storage.

Why are you trying to create migrations on your remote server?

1 like
initech's avatar
Level 10

Yeah I figured it out. I am new to serverless and vapor. Was just playing around with it. Thanks for your answer.

kurucu's avatar

@initech and @snapey there is actually a bit of local, temporary, storage.

Create a Laravel Drive that uses /tmp if you need to use it (e.g. for image processing or similar). /tmp offers 500mb of space that lasts only for the duration of the request.

You just need to stream the file between S3 and tmp at the beginning (or upload it directly) and then save to S3/download prior to the end of the request.

I had to get this working to open Excel files with PHPOffice, to import them into the database, so I'll happily elaborate if needed!

1 like
DomRaymond's avatar

@kurucu Can you elaborate on what you did please? I have to do pretty much exactly what you did, which is to read an Excel file with PHPSpreadsheet. Specifically, I'm looking for your filesystem config code and storing/reading/deleting sequence for the Excel file. Any help would be greatly appreciated.

Please or to participate in this conversation.