Two things I can think of:
- Is SELinux context correct?
- Does
/var/www/testingApi/storage/framework/sessions/folder exists?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I am using Lamp on centos, I have given permission to storage folder 777 but gives failed to open stream Permission denied, following is the permission
drwxrwxrwx. 5 ubaid ubaid 43 Apr 27 18:01 storage
All folders and files have same permissions inside the storage folder. The error I received
ErrorException in Filesystem.php line 109:
file_put_contents(/var/www/testingApi/storage/framework/sessions/81dc54b226f35908288b2753903259bfd723e514): failed to open stream: Permission denied
in Filesystem.php line 109
at HandleExceptions->handleError('2', 'file_put_contents(/var/www/testingApi/storage/framework/sessions/81dc54b226f35908288b2753903259bfd723e514): failed to open stream: Permission denied', '/var/www/testingApi/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php', '109', array('path' => '/var/www/testingApi/storage/framework/sessions/81dc54b226f35908288b2753903259bfd723e514', 'contents' => 'a:3:{s:6:"_token";s:40:"sDXpqJeIvdLfl1T9RnDHxJi4SEoDpoT7SxgcDkjB";s:9:"_sf2_meta";a:3:{s:1:"u";i:1463939936;s:1:"c";i:1463939936;s:1:"l";s:1:"0";}s:5:"flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}', 'lock' => true))
at file_put_contents('/var/www/testingApi/storage/framework/sessions/81dc54b226f35908288b2753903259bfd723e514', 'a:3:{s:6:"_token";s:40:"sDXpqJeIvdLfl1T9RnDHxJi4SEoDpoT7SxgcDkjB";s:9:"_sf2_meta";a:3:{s:1:"u";i:1463939936;s:1:"c";i:1463939936;s:1:"l";s:1:"0";}s:5:"flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}', '2') in Filesystem.php line 109
at Filesystem->put('/var/www/testingApi/storage/framework/sessions/81dc54b226f35908288b2753903259bfd723e514', 'a:3:{s:6:"_token";s:40:"sDXpqJeIvdLfl1T9RnDHxJi4SEoDpoT7SxgcDkjB";s:9:"_sf2_meta";a:3:{s:1:"u";i:1463939936;s:1:"c";i:1463939936;s:1:"l";s:1:"0";}s:5:"flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}', true) in FileSessionHandler.php line 71
at FileSessionHandler->write('81dc54b226f35908288b2753903259bfd723e514', 'a:3:{s:6:"_token";s:40:"sDXpqJeIvdLfl1T9RnDHxJi4SEoDpoT7SxgcDkjB";s:9:"_sf2_meta";a:3:{s:1:"u";i:1463939936;s:1:"c";i:1463939936;s:1:"l";s:1:"0";}s:5:"flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}') in Store.php line 262
at Store->save() in StartSession.php line 88
at StartSession->terminate(object(Request), object(JsonResponse)) in Kernel.php line 155
at Kernel->terminate(object(Request), object(JsonResponse)) in index.php line 58
Please or to participate in this conversation.