代码如下
```php
var_dump($e->getMessage());
exit;
方案二:找到文件:thinkphp\tpl\think_exception.tpl,找到如下位置
代码如下
var_dump($message);
die();
namespace app\index\controller;
use think\facade\Session;
use think\facade\Cache;
class Index
{
public function index()
{
echo ''
;
$data=Session::get();
var_dump($data);
}
public function hello($name = 'ThinkPHP5')
{
return 'hello,' . $name;
}
}
# 配置session
找到文件:\config\session.php
```php
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | 会话设置
// +----------------------------------------------------------------------
return [
'id' => '',
// SESSION_ID的提交变量,解决flash上传跨域
'var_session_id' => '',
// SESSION 前缀
'prefix' => '',
'session_name'=>'PHPREDIS_SESSION:',
// 驱动方式 支持redis memcache memcached
'type' => 'redis',
// 是否自动开启 SESSION
'auto_start' => true,
// 服务器地址
'host' => '127.0.0.1', // 本地环境先开启redis服务端 redis-service.exe
'port' => 6399,
//'weight' => 100,
'timeout'=>30,
'password'=>'pPhKNahLz0Oe9S5',
'select'=>3
];