3
votes

I am trying to load my project on the live server.

these are the specs

PHP version 5.6 Server : Windows

I have loaded all the files and chmod 777

Storage Vendor bootstrap/cache

but it keeps giving me the following streaming error:

Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "C:\inetpub\wwwroot\websites\mysite\storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied' in C:\inetpub\wwwroot\websites\mysite\vendor\monolog\monolog\src\Monolog\Handler\StreamHandler.php:87 Stack trace: #0 C:\inetpub\wwwroot\websites\mysite\vendor\monolog\monolog\src\Monolog\Handler\AbstractProcessingHandler.php(37): Monolog\Handler\StreamHandler->write(Array) #1 C:\inetpub\wwwroot\websites\mysite\vendor\monolog\monolog\src\Monolog\Logger.php(336): Monolog\Handler\AbstractProcessingHandler->handle(Array) #2 C:\inetpub\wwwroot\websites\mysite\vendor\monolog\monolog\src\Monolog\Logger.php(615): Monolog\Logger->addRecord(400, Object(UnexpectedValueException), Array) #3 C:\inetpub\wwwroot\websites\mysite\vendor\laravel\framework\src\Illuminate\Log\Writer.php(202): Monolog\Logger->error(Object(UnexpectedValueExc in C:\inetpub\wwwroot\websites\mysite\vendor\monolog\monolog\src\Monolog\Handler\StreamHandler.php on line 87

Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "C:\inetpub\wwwroot\websites\mysite\storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied' in C:\inetpub\wwwroot\websites\mysite\vendor\monolog\monolog\src\Monolog\Handler\StreamHandler.php:87 Stack trace: #0 C:\inetpub\wwwroot\websites\mysite\vendor\monolog\monolog\src\Monolog\Handler\AbstractProcessingHandler.php(37): Monolog\Handler\StreamHandler->write(Array) #1 C:\inetpub\wwwroot\websites\mysite\vendor\monolog\monolog\src\Monolog\Logger.php(336): Monolog\Handler\AbstractProcessingHandler->handle(Array) #2 C:\inetpub\wwwroot\websites\mysite\vendor\monolog\monolog\src\Monolog\Logger.php(615): Monolog\Logger->addRecord(400, Object(Symfony\Component\Debug\Exception\FatalErrorException), Array)> 3 C:\inetpub\wwwroot\websites\mysite\vendor\laravel\framework\src\Illuminate\Log\Writer.php(202): Monolog\Logger->er in C:\inetpub\wwwroot\websites\mysite\vendor\monolog\monolog\src\Monolog\Handler\StreamHandler.php on line 87

4
cross check 777 applied or not in log folderMansoor H
delete the log filesDsRaj
cross checked but no solution. deleted the logfiles but not working at allGabs

4 Answers

1
votes

You didn't set permissions correctly. You're on Windows, so read this or this. storage folder with all subfolders and files should be accessible to r&w.

1
votes

You need to allow writing for logs dir chmod -R 777 storage/logs

1
votes

I had a similar problem, turns out the server didnt create the file with the correct owner, even though permissions were set correctly. Hope this helps someone!

I deleted that particular log (im using daily logs) and it worked again.

-1
votes

Delete laravel.log file inside logs folder. It worked for me.