Thomasvdw
2 months ago
734
7
Laravel

include(.../Controller.php): failed to open stream: Permission denied

Posted 2 months ago by Thomasvdw

Hi all,

Using: Apache, CentOS 7, Laravel 6.x (to be updated next)

Problem: After successful installation of laravel (default page showing), I have moved my local development files over. Now before replacing the default routes/web.php I wanted to check if things were OK. I added one of the routes, using a just uploaded controller and view.

When I try to access this page (..../profile) it shows following error:

include(.../Controller.php): failed to open stream: Permission denied

Whereas the default page (.../) still works as normal.

What I have done to attempt to fix:

  • sudo chown -R apache.apache /var/www/.../laravel
  • sudo chmod -R 755 /var/www/.../laravel/storage
  • sudo chmod -R 755 /var/www/.../laravel/bootstrap/cache
  • sudo php artisan view:cache

All files (including the default view) are owned by apache.apace, so ownership is the same. As per directory permissions I have set the storage and bootstrap/cache folders (https://laravel.com/docs/6.x). How can this be fixed? I am out of idea to fix this...

Please sign in or create an account to participate in this conversation.