1.Laravel 访问出错错误信息:`Warning: require(/vendor/autoload.PHP):failed to open stream: No such file or dire
错误信息:`Warning: require(/http/www.mywakavLee.cn/Bootstrap/../vendor/autoload.PHP):
- failed to open stream: No such file or directory in /http/www.mywakavLee.cn/Bootstrap/autoload.PHP on line 17
- Fatal error: require():
- Failed opening required '/http/www.mywakavLee.cn/bootstrap/../vendor/autoload.php'
- (include_path='.:/usr/local/lib/php') in /http/www.mywakavLee.cn/Bootstrap/autoload.PHP on line 17`
原因: 网站根目录下缺少 vendor 这个存放 laraver 依赖包的目录
解决方法: 使用 Composer install 进行安装 (没有安装过的情况下, 以前安装过的话使用: Composer update) , 如图:
如果没有安装过, 直接使用了 Composer update 命令, 就会报错.
然后就可以访问网站了.
2.Laravel 出现 "RuntimeException inEncrypter.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
效果:
这时候项目根目录下的. env 文件里的 APP_KEY 应该会有值了:
若没有, 则将上一步生成的 key 值输入进去即可.
来源: http://www.bubuko.com/infodetail-2956939.html