首頁 > 後端開發 > php教程 > laravel 安装后浏览器执行显示如下错误,怎么办?

laravel 安装后浏览器执行显示如下错误,怎么办?

WBOY
發布: 2016-07-06 13:53:31
原創
1947 人瀏覽過

laravel 安装后浏览器执行显示如下错误,怎么办?

Whoops, looks like something went wrong.

1/1
RuntimeException in compiled.php line 7737:
No supported encrypter found. The cipher and / or key length are invalid.
in compiled.php line 7737
at EncryptionServiceProvider->getEncrypterForKeyAndCipher(null, 'AES-256-CBC') in compiled.php line 7727
at EncryptionServiceProvider->IlluminateEncryption{closure}(object(Application), array()) in compiled.php line 1353
at Container->build(object(Closure), array()) in compiled.php line 1309
at Container->make('encrypter', array()) in compiled.php line 1871
at Application->make('IlluminateContractsEncryptionEncrypter') in compiled.php line 1410
at Container->resolveClass(object(ReflectionParameter)) in compiled.php line 1387
at Container->getDependencies(array(object(ReflectionParameter)), array()) in compiled.php line 1373
at Container->build('AppHttpMiddlewareEncryptCookies', array()) in compiled.php line 1309
at Container->make('AppHttpMiddlewareEncryptCookies', array()) in compiled.php line 1871
at Application->make('AppHttpMiddlewareEncryptCookies') in compiled.php line 9921
at Pipeline->IlluminatePipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->IlluminateRouting{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in compiled.php line 9911
at Pipeline->then(object(Closure)) in compiled.php line 8192
at Router->runRouteWithinStack(object(Route), object(Request)) in compiled.php line 8183
at Router->dispatchToRoute(object(Request)) in compiled.php line 8173
at Router->dispatch(object(Request)) in compiled.php line 2416
at Kernel->IlluminateFoundationHttp{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->IlluminateRouting{closure}(object(Request)) in compiled.php line 3283
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9926
at Pipeline->IlluminatePipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->IlluminateRouting{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in compiled.php line 9911
at Pipeline->then(object(Closure)) in compiled.php line 2363
at Kernel->sendRequestThroughRouter(object(Request)) in compiled.php line 2347
at Kernel->handle(object(Request)) in index.php line 54
Whoops, looks like something went wrong.

1/1
RuntimeException in compiled.php line 7737:
No supported encrypter found. The cipher and / or key length are invalid.
in compiled.php line 7737
at EncryptionServiceProvider->getEncrypterForKeyAndCipher(null, 'AES-256-CBC') in compiled.php line 7727
at EncryptionServiceProvider->IlluminateEncryption{closure}(object(Application), array()) in compiled.php line 1353
at Container->build(object(Closure), array()) in compiled.php line 1309
at Container->make('encrypter', array()) in compiled.php line 1871
at Application->make('IlluminateContractsEncryptionEncrypter') in compiled.php line 1410
at Container->resolveClass(object(ReflectionParameter)) in compiled.php line 1387
at Container->getDependencies(array(object(ReflectionParameter)), array()) in compiled.php line 1373
at Container->build('AppHttpMiddlewareEncryptCookies', array()) in compiled.php line 1309
at Container->make('AppHttpMiddlewareEncryptCookies', array()) in compiled.php line 1871
at Application->make('AppHttpMiddlewareEncryptCookies') in compiled.php line 2370
at Kernel->terminate(object(Request), object(Response)) in index.php line 58

回复内容:

laravel 安装后浏览器执行显示如下错误,怎么办?

Whoops, looks like something went wrong.

1/1
RuntimeException in compiled.php line 7737:
No supported encrypter found. The cipher and / or key length are invalid.
in compiled.php line 7737
at EncryptionServiceProvider->getEncrypterForKeyAndCipher(null, 'AES-256-CBC') in compiled.php line 7727
at EncryptionServiceProvider->IlluminateEncryption{closure}(object(Application), array()) in compiled.php line 1353
at Container->build(object(Closure), array()) in compiled.php line 1309
at Container->make('encrypter', array()) in compiled.php line 1871
at Application->make('IlluminateContractsEncryptionEncrypter') in compiled.php line 1410
at Container->resolveClass(object(ReflectionParameter)) in compiled.php line 1387
at Container->getDependencies(array(object(ReflectionParameter)), array()) in compiled.php line 1373
at Container->build('AppHttpMiddlewareEncryptCookies', array()) in compiled.php line 1309
at Container->make('AppHttpMiddlewareEncryptCookies', array()) in compiled.php line 1871
at Application->make('AppHttpMiddlewareEncryptCookies') in compiled.php line 9921
at Pipeline->IlluminatePipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->IlluminateRouting{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in compiled.php line 9911
at Pipeline->then(object(Closure)) in compiled.php line 8192
at Router->runRouteWithinStack(object(Route), object(Request)) in compiled.php line 8183
at Router->dispatchToRoute(object(Request)) in compiled.php line 8173
at Router->dispatch(object(Request)) in compiled.php line 2416
at Kernel->IlluminateFoundationHttp{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->IlluminateRouting{closure}(object(Request)) in compiled.php line 3283
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9926
at Pipeline->IlluminatePipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->IlluminateRouting{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in compiled.php line 9911
at Pipeline->then(object(Closure)) in compiled.php line 2363
at Kernel->sendRequestThroughRouter(object(Request)) in compiled.php line 2347
at Kernel->handle(object(Request)) in index.php line 54
Whoops, looks like something went wrong.

1/1
RuntimeException in compiled.php line 7737:
No supported encrypter found. The cipher and / or key length are invalid.
in compiled.php line 7737
at EncryptionServiceProvider->getEncrypterForKeyAndCipher(null, 'AES-256-CBC') in compiled.php line 7727
at EncryptionServiceProvider->IlluminateEncryption{closure}(object(Application), array()) in compiled.php line 1353
at Container->build(object(Closure), array()) in compiled.php line 1309
at Container->make('encrypter', array()) in compiled.php line 1871
at Application->make('IlluminateContractsEncryptionEncrypter') in compiled.php line 1410
at Container->resolveClass(object(ReflectionParameter)) in compiled.php line 1387
at Container->getDependencies(array(object(ReflectionParameter)), array()) in compiled.php line 1373
at Container->build('AppHttpMiddlewareEncryptCookies', array()) in compiled.php line 1309
at Container->make('AppHttpMiddlewareEncryptCookies', array()) in compiled.php line 1871
at Application->make('AppHttpMiddlewareEncryptCookies') in compiled.php line 2370
at Kernel->terminate(object(Request), object(Response)) in index.php line 58

php artisan key:generate 在命令行生成一个key

把.env的配置 APP_KEY设置一下就可以了,我最近也在学遇到了一样的问题

APP_KEY 无效,配置正确的APP_KEY即可

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板