Permission denied when running sail up - laravel

I've installed laravel 8 and sail, but when I try to run sail up I get this error
vendor/bin/sail: line 14: /home/cerb/projects/timeless-treasures/vendor/laravel/sail/bin/sail: Permission denied

I was running ubuntu on WSL2 and sail up was giving me this permission denied error. You can open your linux/wsl terminal and go one directory up using cd .. then try
chmod -R 777 <project directory name>
this will grant all permissions to your project directory and sail up will start working.

Related

file_put_contents(./composer.lock): failed to open stream: Permission denied Even after running chown command

I am getting this error while installing Laravel latest version on ubuntu 18.04
[ErrorException]
file_put_contents(./composer.lock): failed to open stream: Permission denied
I have even run the following command as suggested by someone in response to the same question
sudo chown -R myuser ~/.composer
Still same error any ideas?
My error was exactly like below after this command: composer update.
[ErrorException]
file_put_contents(./composer.lock): failed to open stream: Permission denied
Solved it only adding sudo command in ubuntu. Full command will be:
sudo composer update
How do you run your php? If it starts when you visit page in browser, then user is www-data and of course there are no permissions.
I think you should try change group of this file:
sudo chgrp www-data ./composer.lock
But I am wondering why do you write into composer lock file? Are you ok?

Fix: Laravel Git Clone in AWS Btnami LAMP Stack Error

I git cloned a laravel site into a bitnami LAMP stack and it is producing this error.
UnexpectedValueException
The stream or file "/opt/bitnami/projects/mel/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
Run this command sudo chmod -R 777 storage in your project directory

How to fix Error: laravel.log could not be opened Permission denied?

I'm pretty new at laravel,Actually when i create this command php artisan migration so i face this error how can i resolve this issue thanks.
Error
UnexpectedValueException : The stream or file
"/home/zubair/htdocs/project/storage/logs/laravel.log" could not be opened: failed to open
stream: Permission denied
If you run the command with sudo or chmod -R 755 some of the project's folders, you'll have it working.
sudo chmod -R 755 storage bootstrap/cache
Changing entire project folder's permission is probably not a good idea as your project becomes accessible to any user/script which kind of defeats the purpose of securing it behind root.
change a permission of storage folder
sudo chmod -R 775 /var/www/html/your-project/storage
for more info check this link install laravel in apache

Windows Laravel update: composer failed to open stream, permission denied

Initially I was trying to update to Laravel 5.6 from 5.5, however nothing works anymore since I ran composer update. I can't even go back to 5.5, always get the same error:
In Filesystem.php line 122:
file_put_contents(C:\Users...\laravelprojectroot\bootstrap/cache/packages.php): failed to open stream: Permission denied
I tried deleting the cache, deleting vendor dictionary and deleting packages.php. Once I ran composer update, I cannot edit or delete packages.php even with root permission on my laptop.
Please help.
Open cmd prompt or git bash with admin privilege, That solves this issue.
Create these directories if they don't exist:
storage/framework/cache
storage/framework/sessions
storage/framework/views
Then delete bootstrap/cache files
Test if it works, if not, try giving the correct permissions to the storage folder: chmod -R 775 storage/

"permission denied" laravel new homestead ubuntu 16.04

when i run laravel new <new project> i got error like this
PHP Warning: file_put_contents(/home/vagrant/Code/laravel_6c11ebb11f0426f74820afdfb31f24e2.zip): failed to open stream: Permission denied in /home/vagrant/.composer/vendor/laravel/installer/src/NewCommand.php on line 139
i have run sudo chmod -R 777 <name folder> and sudo chown -R vagrant <name folder> but still got the same error.
I try to make new folder with mkdir and i got permission denied. i guessed this about permission problem. but i don't how to solve it

Resources