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

AbdulBazith's avatar

The stream or file "/home/project/public_html/projectfolder/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied

guys iam working with a online student exam application.

i have hosted the application in cpanel and everything went fine. suddenly i face an error from today morning

The stream or file "/home/project/public_html/projectfolder/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied

vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php

it showing like this. through my cpanel terminal i did all the below

php artisan optimize
php artisan cache:clear
php artisan route:cache
php artisan view:clear
php artisan config:cache

composer dump-autoload

but still the same error. when i referred in google it show to restart the Apache or change the permission

but when i asked my server team they saying the permission is correct. it is a fault in laravel application only.

what i should do now??

this is my cpanel permission : https://imgur.com/DnFekGp

the application went smoothly. but from today morning its saying like this

do i need to check from my cpanel? do i need to check from my WHM? do i need to check in my laravel application?

kindly some one suggest your idea please

0 likes
2 replies
Sergiu17's avatar

you need to give permissions to storage directory

sudo chmod -R 775 /storage
AbdulBazith's avatar

@sergiu17 thank you for your response.

the same error.

actually,i had a backup in my local system, so what i did i created a new folder in cpanel and put the backup project. but that too shows the same error. this backup is took yesterday only. till yesterday eve it worked correctly..

Please or to participate in this conversation.