laravel上传至服务器上出现Whoops, looks like something went wrong.

1.在本地能够很好运行的laravel,上传至服务器就出现了这个问题“Whoops, looks like something went wrong.”;

2.第一步把config/app.php文件内'debug' => env('APP_DEBUG', false),改成'debug' => env('APP_DEBUG', true),

3.现在显示出了很多信息

laravel上传至服务器上出现Whoops, looks like something went wrong.

我们注意到No supported encrypter found.The cipher and / or key length are invalid.这句,所以我们把本地.env文件的APP_KEY值复制下来修改config/app.php内

'key' => env('APP_KEY','base64:R+8tyPpcbK6ELMheXa4D8hsxdVvXDilVUSFCFqaH8vY='),

这个APP_KEY也可通过php artisan key:generate生成;

4.现在又报另一个错误

laravel上传至服务器上出现Whoops, looks like something went wrong.

这里说明是数据库连接出错,修改config/database.php文件的数据库连接问题'mysql' => [

'driver' => 'mysql',

'host' => env('DB_HOST', 'localhost'),

'port' => env('DB_PORT', '3306'),

'database' => env('DB_DATABASE', 'forge'),

'username' => env('DB_USERNAME', 'forge'),

'password' => env('DB_PASSWORD', ''),

'charset' => 'utf8',

'collation' => 'utf8_unicode_ci',

'prefix' => 'pty_',

'strict' => false,

'engine' => null,

],

修改相应数据库配置即可;

5.当登录后台总管理员时没有问题,但是登录添加的管理员时又报错

laravel上传至服务器上出现Whoops, looks like something went wrong.

出现这个问题是缓存的问题,修改config/cache.php文件,把'default' => env('CACHE_DRIVER', 'file'),改为

'default' => env('CACHE_DRIVER', 'array'),

因为在使用Zizaco\Entrust这个权限包添加角色的时候出现了这种错误。

laravel上传至服务器上出现Whoops, looks like something went wrong.

上一篇:IIS (安装SSL证书后) 实现 HTTP 自动跳转到 HTTPS


下一篇:基于paramiko将文件上传到服务器上