Search code examples
phplaravellaravel-5.5php-7

Laravel file_exists(): open_basedir restriction in effect in shared Host


Hi everyone we developed project with laravel framework and everythings ok in local and vps server, when we want to move the project to shared host , we just move the project files and clear cache files ans setup database confog in env file, but when refresh the site we face the error:

file_exists(): open_basedir restriction in effect. File(/home/loca/domains/loca.cf/libs/storage/framework/sessions/JPdCM3pG7UDe6fIPXwyxSzfCRJuqCAn8xYDXRW7B) is not within the allowed path(s): (/home/amenc/:/tmp:/var/tmp:/usr/local/lib/php/:/usr/local/php56/lib/php/)

our php version is 7 but the host version is 5.6, is that make problem? we try more than two days to solve that but we cannot please help us to upload the site, thanks alot :)


Solution

  • Laravel 5.5 requires PHP 7 or above. You need to upgrade your PHP to version 7. If problem still persist after upgrade, try to clear cache using php artisan cache:clear and make sure that laravel /storage directory is accessible for web server user.

    https://laravel.com/docs/5.5#server-requirements