Error:Failed to open stream: Permission denied in Laravel?

0 votes

I'm having problem in setting up Laravel. I'm having this error when opening the index page:

file_put_contents(/Users/laravel/app/storage/meta/services.json) [function.file-put-contents]:
failed to open stream: Permission denied.

What am I missing here?

Apr 3 in Laravel by kartik
• 10,990 points
374 views

1 answer to this question.

0 votes

Hii @kartik,

To solve permissions issue on Laravel, I have done this (with root user):

cd app/

chown -R www-data:www-data storage

cd storage/

find . -type d -exec chmod 775 {} \; && find . -type f -exec chmod 664 {} \;

And always in app/storage directory :

chown your_user:user_group .gitignore cache/.gitignore logs/.gitignore meta/.gitignore sessions/.gitignore views/.gitignore

Now, exit the root user, and it's ok.

Hope this works!!

Thank You!

answered Apr 3 by Niroj
• 22,110 points

Related Questions In Laravel

0 votes
1 answer

Error:login in Laravel. How to solve?

Hey, First check if your model login has a field password in ...READ MORE

answered Mar 26 in Laravel by Niroj
• 22,110 points
84 views
0 votes
1 answer

Error:Laravel Installation failed, reverting ./composer.json to its original content.?

Hello, You need to install php zip extension. Something ...READ MORE

answered Mar 26 in Laravel by Niroj
• 22,110 points
821 views
0 votes
1 answer

Error: “No scheduled commands are ready to run.” in Laravel?

Hello @kartik, Run php artisan and see if your commands ...READ MORE

answered Apr 6 in Laravel by Niroj
• 22,110 points
228 views
0 votes
1 answer

How to pass URL param in Laravel?

Hello, First you have to go to routes ...READ MORE

answered Mar 18 in Laravel by Niroj
• 22,110 points
101 views
0 votes
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18 in Laravel by Niroj
• 22,110 points
417 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18 in Laravel by Niroj
• 22,110 points
62 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23 in Laravel by Niroj
• 22,110 points
64 views
0 votes
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23 in Laravel by Niroj
• 22,110 points
139 views
0 votes
1 answer

Error: Exception file_put_contents failed to open stream: No such file or directory in Laravel?

Hello, You should typically run the php artisan config:cache command ...READ MORE

answered Mar 31 in Laravel by Niroj
• 22,110 points
644 views
0 votes
1 answer

Error:file_put_contents(meta/services.json): failed to open stream: Permission denied?

Hello @kartik, Below steps helped me fix the ...READ MORE

answered Apr 3 in Laravel by Niroj
• 22,110 points
634 views