Permission denied issue in Laravel 5.1 - laravel

PHP Fatal error in laravel 5.1:
Uncaught exception 'UnexpectedValueException' with message 'The stream
or file "/var/www/html/SocialNet/storage/logs/laravel.log" could not
be opened: failed to open stream: Permission denied' in
/var/www/html/SocialNet/bootstrap/cache/compiled.php:13090\nStack
trace:\n#0 /var/www/html/SocialNet/bootstrap/cache/compiled.php(13030)

This is a log file permissions problem.
Some of the possible solutions:
give write permissions to that file
change the log file path to another you can write to
change the log output driver
disable logging
How to configure log
How to deal with log file path and permissions

Related

Permission error when logging into Heroku from command line

When I try to login with
$heroku login
I am sent to the browser to log in, but upon return I receive this error:
heroku: Waiting for login...
Logging in... done
Error: EPERM: operation not permitted, open 'C:/Users/<My User>/_netrc'
I tried opening that file and I saw the password was incorrect so I changed it on heroku and in the file. Still have the error. I wonder if it is saying that it doesn't have permission to open that file?
Find the _netrc file. Open settings and toggle readonly to on, save, then turn off.

Laravel - The stream or file failed to open stream: Permission denied

I know this is a common problem on Laravel, but I think I'm having a different issue or else the settings aren't being updated.
I've looked at this Laravel The stream or file "/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied and this How to set up File Permissions for Laravel 5 (and others) but I still have this issue:
The stream or file "/var/www/html/laravelwebapp/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
When I do this after going into the logs directory: $ ls -l laravel.log
I get this:
-rwxrwxr-x 1 apache apache 0 Feb 8 2018 laravel.log
I'm on CentOS which is why the group/user is apache not www-data. Yet even though the log is created by apache and apache is the owner and group, it can't open the stream? Does this mean Laravel is executing as another user? I'm a bit confused here, sorry :/
I've cleared the cache using artisan and also ran composer dump-autload but I can't seem to progress in my application because the log doesn't get written to.
Update: My php application is running as nobody when I run
echo exec('whoami');
Is this the problem and how do I fix that?

Laravel New Project - Permission Denied

I am trying to setup a new Laravel site and I am running into an issue I have never had such problems with before. When loading up my site, I get the error:
The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
I have edited the file permissions to 775. I don't know what else to do!
Try changing the owner of the folder:
chown -R apache:apache /var/www/html/
you should change your project folder permission
The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
This error basically happens when in your project absent ../storage/logs folder. Firstly you must be check this folder exists in your project. If does not exist this folder add it and inside it .gitignore file.
/storage/logs/.gitignore
*
!.gitignore

How to solve laravel file_input_error

When I log in, this error show ->
i already give permission to src/storage
file_put_contents(/var/www/html/catalog/src/storage/framework/cache/55/f9/55f98a9ae16c0c5f7c41c2f6d5435d3f37274a71): failed to open stream: No such file or directory
Create cache directory in storage directory, and give him read & write permission to it. Error saying that your cache directory does not exists

Persistent Permission Denied Error

I have seen a few posts on this (and tried the recommended solutions) but they are regarding Laravel 4 - And I am on Laravel 5.
For example;
'Failed to open stream: Permission denied' error - Laravel
I get the Command "dump-autoload" is not defined error and the reason for that is explained here;
http://laravel.io/forum/12-08-2014-command-dump-autoload-is-not-defined
In the above post, composer dump-autoload was suggested. I tried it, and again this morning the same error is back;
ErrorException in Filesystem.php line
74:file_put_contents(/vagrant/source/laravel- excel/storage/
framework/sessions/8338f386fc3de7bdc8d1b6dc7ee6790f71516d98): failed
to open stream: Permission denied`
Any suggestions?
Also, try the above comments and do a
composer self update
You Have to set the permission to Read & Write
In Mac We do this by using
**sudo chmod -R o+w storage**
Storage is the name of file U want to change permission
And currently my terminal is in the same folder where my storage folder is present therefore I did not specify its address

Resources