Please provide a valid cache path

前端 未结 20 794
一生所求
一生所求 2020-12-12 12:15

I duplicated a working laravel app and renamed it to use for another app. I deleted the vendor folder and run the following commands again:

composer self-up         


        
相关标签:
20条回答
  • Try the following:

    create these folders under storage/framework:

    • sessions
    • views
    • cache/data

    if still it does not work then try

    php artisan cache:clear
    php artisan config:clear
    php artisan view:clear
    

    if get an error of not able to clear cache. Make sure to create a folder data in cache/data

    0 讨论(0)
  • 2020-12-12 12:54

    So apparently what happened was when I was duplicating my project the framework folder inside my storage folder was not copied to the new directory, this cause my error.

    0 讨论(0)
  • 2020-12-12 12:54

    I solved this problem by adding this line in my index.php:

    $app['config']['view.compiled'] = "storage/framework/cache";
    
    0 讨论(0)
  • 2020-12-12 12:55

    You can edit your readme.md with instructions to install your laravel app in other environment like this:

    ## Create folders
    
    ```
    #!terminal
    
    cp .env.example .env && mkdir bootstrap/cache storage storage/framework && cd storage/framework && mkdir sessions views cache
    
    ```
    
    ## Folder permissions
    
    ```
    #!terminal
    
    sudo chown :www-data app storage bootstrap -R
    sudo chmod 775 app storage bootstrap -R
    
    ```
    
    ## Install dependencies
    
    ```
    #!terminal
    
    composer install
    
    ```
    
    0 讨论(0)
  • 2020-12-12 12:55

    I also had a similar case after copying a project on a production server. The public folder was accessed by Apache via a symbolic link.

    For Apache or the PHP service, the path to the project has not changed, thus they used cached file paths that lead to the old project repository.

    Restarting Apache and PHP service resolved the issue.

    0 讨论(0)
  • 2020-12-12 12:56

    My 2 cents

    Remove everything inside storage and then do this:

    > cd storage/
    > mkdir -p framework/{sessions,views,cache}
    > chmod -R 777 framework
    
    // This last line depends on your user group settings so 
    // it may not be applicable to you.
    > chown -R www-data:www-data framework
    
    

    Worked for me =)

    0 讨论(0)
提交回复
热议问题