如何修复Encrypter.php第43行中的-RuntimeException
App.php-文件 这是我的应用程序,php文件 .env-文件 这是我的.env文件 错误是:如何修复Encrypter.php第43行中的-RuntimeException,php,laravel-5.3,Php,Laravel 5.3,App.php-文件 这是我的应用程序,php文件 .env-文件 这是我的.env文件 错误是: > RuntimeException in Encrypter.php line 43: The only supported ciphers > are AES-128-CBC and AES-256-CBC with the correct key lengths. 开发者请帮我解决这个问题。 谢谢 您只能键入cmd: php artisan key:generate 我这样做
> RuntimeException in Encrypter.php line 43: The only supported ciphers
> are AES-128-CBC and AES-256-CBC with the correct key lengths.
开发者请帮我解决这个问题。
谢谢
您只能键入cmd:
php artisan key:generate
我这样做的方式是运行
php artisan key:generate
。然后,我复制了括号中的输出,并将.env文件作为APP_KEY=base64:keygoesherenotpostingmyrealkey放入我的.env文件中。我做了php-artisan-config:clear
,然后php-artisan-config:cache
,现在一切都正常了 检查以确保您的.env
文件在APP_KEY
中有值,如果没有,您只创建了一个新项目或克隆了一个项目,您需要在控制台或终端中运行php artisan key:generate
。您是否尝试过运行php artisan config:clear
?APP\u key
值错误。尝试php artisan key:generate
生成新密钥您的密钥太短,在php密钥大小中,AES-128、192和256分别使用16、24或32字节的密钥,但我不确定幼虫如何处理……您是否尝试过手动编辑Encrypter.php。在构造中包含$cipher='AES-256-CBC'?更多信息请参见密钥长度似乎是正确的,但是,您将base64放在下面的位置:在增加所需的密钥长度之前,请删除base64:
> RuntimeException in Encrypter.php line 43: The only supported ciphers
> are AES-128-CBC and AES-256-CBC with the correct key lengths.
php artisan key:generate