search

Home  >  Q&A  >  body text

Laravel 5 opens the page and reports an error

There are 2 questions:
1. Local php artisan serve can be used
2. I don’t know why after moving the server, it will create or read files in the / directory, so there is no permission and an error is reported
3 . It is a permission directory, and it has also been 777ed. However, it should not be a simple permission, because it is impossible for the program to read /. All relative directories are used, but I don’t know where this absolute directory is used.

ErrorException in Filesystem.php line 109:
file_put_contents(/b53e72be8b40e01b5dd6a10f6254791b9c073338.php): failed to open stream: Permission denied

Already tried:

php artisan clear-compiled
php artisan optimize      
php artisan cache:clear
过去多啦不再A梦过去多啦不再A梦2750 days ago543

reply all(4)I'll reply

  • 黄舟

    黄舟2017-05-16 16:50:24

    The problem is found. If there is no views directory, it will go to the root directory

    Filesystem.php, if no path is passed, it will be empty...

     public function put($path, $contents, $lock = false)
        {
            return file_put_contents($path, $contents, $lock ? LOCK_EX : 0);
        }

    I deleted the entire storage directory before migrating, but now I forgot to rebuild the views directory when rebuilding

      /*
        |--------------------------------------------------------------------------
        | Compiled View Path
        |--------------------------------------------------------------------------
        |
        | This option determines where all the compiled Blade templates will be
        | stored for your application. Typically, this is within the storage
        | directory. However, as usual, you are free to change this value.
        |
        */
    
        'compiled' => realpath(storage_path('framework/views')),

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-16 16:50:24

    Permission denied

    Permission issue

    reply
    0
  • 阿神

    阿神2017-05-16 16:50:24

    Insufficient permissions:

    chown -R www-data:www-data /var/www
    chmod 777 -R /var/www/html/storage

    reply
    0
  • 阿神

    阿神2017-05-16 16:50:24

    It is probably a permissions issue. All laravel deployment issues can be solved here. Just choose your own server version http://bbs.earnp.com/blog?tit...

    reply
    0
  • Cancelreply