2015-11-22 73 views
1

你好親愛的提供者許多問題的許多問題!Laravel 5.1:類緩存不存在

我用了一段時間的現在(5年+),雖然大多被動。這一次,我遇到了一個讓我整晚都無法解決的問題。

這是它的全部內容。我將Laravel 5.1與Redis結合使用(緩存&會話)。可悲的是,當我切換到Nginx並升級一些軟件包(作曲家)時,一切都停止了。 Laravel打印出以下例外:

ReflectionException in Container.php line 737: 
Class cache does not exist 
in Container.php line 737 
at ReflectionClass->__construct('cache') in Container.php line 737 
at Container->build('cache', array()) in Container.php line 627 
at Container->make('cache', array()) in Application.php line 674 
at Application->make('cache') in Container.php line 1159 
at Container->offsetGet('cache') in SessionManager.php line 156 
at SessionManager->createCacheHandler('redis') in SessionManager.php line 128 
at SessionManager->createRedisDriver() in Manager.php line 87 
at Manager->createDriver('redis') in Manager.php line 63 
at Manager->driver() in SessionServiceProvider.php line 48 
at SessionServiceProvider->Illuminate\Session\{closure}(object(Application), array()) in Container.php line 734 
at Container->build(object(Closure), array()) in Container.php line 627 
at Container->make('session.store', array()) in Application.php line 674 
at Application->make('Illuminate\Session\Store') in LittleGateKeeperServiceProvider.php line 39 
at LittleGateKeeperServiceProvider->register() in Application.php line 531 
at Application->register(object(LittleGateKeeperServiceProvider)) in ProviderRepository.php line 74 
at ProviderRepository->load(array('Illuminate\Encryption\EncryptionServiceProvider', 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 'Illuminate\Auth\AuthServiceProvider', 'Illuminate\Broadcasting\BroadcastServiceProvider', 'Illuminate\Bus\BusServiceProvider', 'Illuminate\Cache\CacheServiceProvider', 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', 'Illuminate\Routing\ControllerServiceProvider', 'Illuminate\Cookie\CookieServiceProvider', 'Illuminate\Database\DatabaseServiceProvider', 'Illuminate\Filesystem\FilesystemServiceProvider', 'Illuminate\Foundation\Providers\FoundationServiceProvider', 'Illuminate\Hashing\HashServiceProvider', 'Illuminate\Mail\MailServiceProvider', 'Illuminate\Pagination\PaginationServiceProvider', 'Illuminate\Pipeline\PipelineServiceProvider', 'Illuminate\Queue\QueueServiceProvider', 'Illuminate\Redis\RedisServiceProvider', 'App\Providers\PasswordResetServiceProvider', 'Illuminate\Session\SessionServiceProvider', 'Illuminate\Translation\TranslationServiceProvider', 'Illuminate\Validation\ValidationServiceProvider', 'Illuminate\View\ViewServiceProvider', 'Lahaxearnaud\LaravelPushbullet\LaravelPushbulletServiceProvider', 'Spatie\Backup\BackupServiceProvider', 'Collective\Remote\RemoteServiceProvider', 'Vinkla\Pusher\PusherServiceProvider', 'Way\Generators\GeneratorsServiceProvider', 'Xethron\MigrationsGenerator\MigrationsGeneratorServiceProvider', 'App\Providers\AppServiceProvider', 'App\Providers\EventServiceProvider', 'App\Providers\RouteServiceProvider', 'Tymon\JWTAuth\Providers\JWTAuthServiceProvider', 'ConnorVG\Transform\TransformServiceProvider', 'Maatwebsite\Excel\ExcelServiceProvider', 'yajra\Datatables\DatatablesServiceProvider', 'Fadion\Bouncy\BouncyServiceProvider', 'Spatie\LittleGateKeeper\LittleGateKeeperServiceProvider')) in Application.php line 507 
at Application->registerConfiguredProviders() in RegisterProviders.php line 17 
at RegisterProviders->bootstrap(object(Application)) in Application.php line 203 
at Application->bootstrapWith(array('Illuminate\Foundation\Bootstrap\DetectEnvironment', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', 'Illuminate\Foundation\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', 'Illuminate\Foundation\Bootstrap\RegisterFacades', 'Illuminate\Foundation\Bootstrap\RegisterProviders', 'Illuminate\Foundation\Bootstrap\BootProviders')) in Kernel.php line 222 
at Kernel->bootstrap() in Kernel.php line 117 
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87 
at Kernel->handle(object(Request)) in index.php line 54 

值得一提:我安裝了predis,打開resty for nginx。 奇怪的是,如果我使用文件緩存驅動程序,它運行得很好,沒有任何例外。如果我通過cli ping redis,我會得到正確的'PONG'響應,並且我不知道現在該怎麼做..(除了不使用redis驅動程序;-))。

也許值得一提的是,如果我通過CLI運行工匠命令它給了我不同的錯誤:

PHP Catchable fatal error: Argument 2 passed to   Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request, null given, called in /var/www/html/*laravel-project*/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php on line 62 and defined in /var/www/html/*laravel-project*/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php on line 99 

Catchable fatal error: Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request, null given, called in /var/www/html/*laravel-project*/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php on line 62 and defined in /var/www/html/*laravel-project*/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php on line 99 

所以我有想法,有可能是錯誤的東西與我的nginx的虛擬主機的配置(這是服務器設置的主要變化)。虛擬主機看起來像這樣:

server { 
    listen  80 default_server; 
    #listen  [::]:80 default_server ipv6only=on; ## listen for ipv6 
    server_name *MY_SERVER_NAME*; 
    root   /sites/*LARAVEL_PROJECT*/public; 
    charset utf-8; 

    # Elastic search api config 
    location /elastic { 
     proxy_pass http://localhost:9200; 
     proxy_http_version 1.1; 
     proxy_set_header Upgrade $http_upgrade; 
     proxy_set_header Connection 'upgrade'; 
     proxy_set_header Host $host; 
     proxy_cache_bypass $http_upgrade; 
    } 


    #auth_basic_user_file /etc/nginx/htpasswd.users; 
    # Kibana web access 
    location /kibana { 
     auth_basic "Restricted Access"; 
     auth_basic_user_file /etc/nginx/htpasswd.users; 
     proxy_pass http://localhost:5601; 
     proxy_http_version 1.1; 
     proxy_set_header Upgrade $http_upgrade; 
     proxy_set_header Connection 'upgrade'; 
     proxy_set_header Host $host; 
     proxy_cache_bypass $http_upgrade; 
    } 

    # entry point to the Laravel project 
    location/{ 
     try_files $uri $uri/ /index.php?$query_string; 
    } 

    access_log /var/log/nginx/laravel-project-access.log; 
    error_log /var/log/nginx/laravel-project-error.log error; 

    sendfile off; 
    client_max_body_size 100m; 

    location ~ \.php$ { 
     fastcgi_split_path_info ^(.+\.php)(/.+)$; 
     fastcgi_pass unix:/var/run/php-fpm.sock; 
     fastcgi_index index.php; 
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
     include fastcgi_params; 
     fastcgi_buffer_size 16k; 
     fastcgi_buffers 4 16k; 
    } 

    location ~ /\.ht { 
     deny all; 
    } 
} 

任何想法或建議?

Thx提前!

+0

最後我重新安裝幾乎所有的。突然經過很多努力(付出太多努力),甚至考慮完全重新安裝CentOS,它自動地重新開始工作。從那一刻起,我沒有遇到任何問題,希望它保持那樣! –

回答

0

可能是你使用的網址()幫助像下面的代碼的任何配置文件,檢查出來並刪除它..

url('bassets/plugins/highcharts/highcharts.css')