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

adjaf's avatar
Level 1

Storage/app not readable CentOS

Hello, we're working on Laravel as API, we're storing images in database with:

Storage::disk('local')->put($path, $file);

There's no issue there, however when trying to read the route of storage/app we get an exception:

{
"message": "The root path /var/www/html/projects/laravel-pro/storage/app is not readable.",
    "exception": "LogicException",
    "file": "/var/www/html/projects/laravel-pro/vendor/league/flysystem/src/Adapter/Local.php",
  "line": 81
}

I found out that it has to be with is_readable($path), however the route is not protected for apache user.

We're setting the url with https with no port like this: https:://pro.laraveldev.com, ¿What could the problem be? Apache has permissions for writting and reading everything on the project folder

0 likes
4 replies
mattsplat's avatar

Did you create the symlink with php artisan storage:link?

hollyit's avatar

Make sure that path is accessible by PHP (whatever user PHP is running as if using FPM, or the webserver is running as). On CentOS with SELinux, permissions are more sensitive (for good reasons).

adjaf's avatar
Level 1

@mattsplat yes i did it that way, actually i can see the files by entering the URL for example:

https://pro.laraveldev.com/storage/images/img1.jpg 

When I make the call to the route of the API by using the IP for example:

123.345.678.9:8000/api/save_file

It doesn't return the error

@hollyit it supposed that the apache server has permissions for all in the project folder, anyways let me check about selinux and the PHP access

hollyit's avatar

@adjaf - You can look in /var/log/audit at the log files and see if there's anything from selinux in there. It can be a real pain to configure. It should be ok since the rest of the app is working, but if a flag somehow gets screwed up on a directory, then that causes headaches (you can view flags with ls -Z).

Before that though, I would double check users and permissions. /storage should have +rwx for user and group.

Please or to participate in this conversation.