Morph-UK's avatar

Problem with setting storage directory

Hello

My project root directory is not writable by the www-data web server user.

I've had no issues in the past with moving this directory outside of the project root.

Right now I'm having issues.

These give correct paths:

env('LARAVEL_STORAGE_PATH')
config('view.compiled')

However this helper:

storage_path()

gives the wrong path (the default one):

[project root]/storage

How do I fix this?

0 likes
5 replies
Snapey's avatar

create another filesystem disk and use that as the default.

Morph-UK's avatar

@Snapey unfortunately that's not possible for the project root.

It's stored on an NTFS Windows 11 C: drive, for editing in PhpStorm on Windows.

Passed to a HyperV Debian CIFS mount, which is the Docker host.

Then passed to Docker container.

Previously I had no issue with this setup, using an XFS filesystem for the storage/* files.

Laravel 10 was OK, I'm not sure what has changed.

Snapey's avatar

@Morpth How do you expect to save files then if you have no writable storage

Morph-UK's avatar

@Snapey writable storage is configured to XFS native storage in the container:

/data/[subdirectory here]

with valid permissions for www-data user.

Worked previously.

Snapey's avatar

@Morpth So I don't understand why you cannot create a laravel storage disk using that path

Please or to participate in this conversation.