TP5.1安装后访问报错【已解决】

浏览:1033 发布日期:2020/03/29 分类:求助交流
composer 创建拉取的tp不完整? 官网下载的包正常

composer create-project topthink/think=5.1.* tp51 命令安装后访问配置的域名提示
这是怎么回事呢,一直用的 Laravel 正常,想用下TP,没想到报这个 控制器不存在,事实默认控制器是存在的,新建控制器绑定路由也是报控制器不存在

[0] HttpException in Module.php line 96
控制器不存在:app\index\controller\Index
$this->app['hook']->listen('module_init');

try {
// 实例化控制器
$instance = $this->app->controller($this->controller,
$this->rule->getConfig('url_controller_layer'),
$this->rule->getConfig('controller_suffix'),
$this->rule->getConfig('empty_controller'));
} catch (ClassNotFoundException $e) {
throw new HttpException(404, 'controller not exists:' . $e->getClass());
}

$this->app['middleware']->controller(function (Request $request, $next) use ($instance) {
// 获取当前操作名
$action = $this->actionName . $this->rule->getConfig('action_suffix');

if (is_callable([$instance, $action])) {
// 执行操作方法
$call = [$instance, $action];
最佳答案
评论( 相关
后面还有条评论,点击查看>>