Rah*_* za 77 php ssl laravel-5
我正在使用Laravel构建一个项目.它在localhost上工作正常,但是当我将它上传到服务器(服务器安装了comodo ssl)时,我收到以下错误:
RuntimeException in EncryptionServiceProvider.php line 29:
No supported encrypter found. The cipher and / or key length are invalid
in EncryptionServiceProvider.php line 29
at EncryptionServiceProvider->Illuminate\Encryption\{closure}(object(Application), array()) in Container.php line 733
at Container->build(object(Closure), array()) in Container.php line 626
at Container->make('encrypter', array()) in Application.php line 674
at Application->make('Illuminate\Contracts\Encryption\Encrypter') in Container.php line 837
at Container->resolveClass(object(ReflectionParameter)) in Container.php line 800
at Container->getDependencies(array(object(ReflectionParameter)), array()) in Container.php line 771
at Container->build('SahraSalon\Http\Middleware\EncryptCookies', array()) in Container.php line 626
at Container->make('SahraSalon\Http\Middleware\EncryptCookies', array()) in Application.php line 674
at Application->make('SahraSalon\Http\Middleware\EncryptCookies') in Pipeline.php line 123
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 118
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 86
at Kernel->handle(object(Request)) in index.php line 54
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮助解决此错误?
ona*_*uez 93
您只需键入控制台:
php artisan key:generate
Run Code Online (Sandbox Code Playgroud)
如果您的app.php没有更改此密钥,请手动更改.
接下来,如果您应该碰巧收到此错误消息:
[ErrorException]
file_get_contents(/path/to/my/project/.env):无法打开流:没有这样的文件或目录
然后复制该.env.example文件,然后重试:
cp .env.example .env
php artisan key:generate
Run Code Online (Sandbox Code Playgroud)
Sal*_*lkz 68
您是否在服务器上安装了所有必要的扩展程序?
可能是你错过了OpenSSL扩展.此外,你有.env文件中的密钥集吗?
试试跑步:
php artisan key:generate
答:'cipher' => ''没有设定.
小智 9
我之前有同样的问题,我按照这种方式修复它:转到config/app.php,"cipher" => "anything"改为
'cipher' => MCRYPT_RIJNDAEL_128,
Run Code Online (Sandbox Code Playgroud)
小智 7
我只是修正错误.
Shift+Click 右键从你的根项目"在这里打开推荐窗口". "php artisan key:generate".config/app.php赞'key' => env('APP_KEY', 'insert get 32 char key'),//第81行就我而言,我需要启用 mcrypt 扩展。
但首先,检查您是否已经拥有它:
$ sudo apt-get install -y mcrypt php5-mcrypt
Run Code Online (Sandbox Code Playgroud)
检查 mcrypt 模块是否已加载:
$ php -m | grep mcrypt
Run Code Online (Sandbox Code Playgroud)
如果什么都不显示,是因为没有加载,但是你上面已经安装了对吗?所以这样做:
$ php5enmod mcrypt
$ sudo service apache2 restart
Run Code Online (Sandbox Code Playgroud)
再次检查,您应该看到 mcrypt 而不是什么都没有。这是一个好兆头,重新加载您的应用程序并修复您的下一个错误;)
$ php -m | grep mcrypt
mcrypt
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
77976 次 |
| 最近记录: |