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

lentichin's avatar

What can I do to increase the stability of a Laravel application running off SD cards?

Hi,

I was wondering if anyone has experience deploying a Laravel application that is running off an SD card.

Right now we have these routers that have an SD card slot and run linux. Because of this we have managed to put a Laravel application on the SD card. The Laravel application uses SQLite, as well as local storage, to serve audio and images with a total single user experience of about 5mb.

Most of the activity involve reading from the filesystem, there's very little writes. But with Laravel writes are needed for session storage and view caching.

The problem is that I've experienced about 80% stability with the SD card.

When taking the SD card out and placing the codebase on it in MacOS Finder - what I do is drag a single www folder for the entire laravel application. And that's it in one step! It works on the router.

The only thing is sometimes I get the error (cannot write to this folder (storage/framework/views)) and I see it is because the SD card locks up and becomes read-only.

But it's completely random! Most of the time the storage folder is writeable! Unplugging and plugging the router makes the SD card work again and the app work normally.

When it locks up sometimes it shows a white page. It is scary.

Another minor problem is that SD cards don't seem to support symlinks, so for this application anytime there is an update, I have to recursively copy the storage app public folder to public storage. I've tried rsync but got an executable error. I wish there were a way around symlinks But this is a minor problem compared to the SD card locking up randomly.

What can I do to increase the stability of a Laravel application running on an SD card? Are there SD cards that have extra extra stability or something?

0 likes
1 reply
Snapey's avatar

What you are asking is like saying

"everytime I use a screwdriver to hammer in a nail it damages the handle of the screwdriver - any suggestions'

My advice is to use the right tool for the job.

1 like

Please or to participate in this conversation.