doudeng5764 2018-06-04 01:14
浏览 319

mac-thinkphp控制器不存在

My Index.php has two functions. index of function is good, but test of function is bad. I have no idea.

[0] HttpException in App.php line 578 控制器不存在:app\index\controller\Test

    try {
        $instance = Loader::controller(
            $controller,
            $config['url_controller_layer'],
            $config['controller_suffix'],
            $config['empty_controller']
        );
    } catch (ClassNotFoundException $e) {
        throw new HttpException(404, 'controller not exists:' . $e->getClass());
    }

    // 获取当前操作名
    $action = $actionName . $config['action_suffix'];

    $vars = [];
    if (is_callable([$instance, $action])) {
        // 执行操作方法
        $call = [$instance, $action];
Call Stack
in App.php line 578
at App::module(['index', 'test', null], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], true) in App.php line 456
at App::exec(['type' => 'module', 'module' => ['index', 'test', null]], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
at App::run() in start.php line 19
at require('/Library/WebServer/D...') in index.php line 17
Environment Variables
GET Dataempty
POST Dataempty
Filesempty
Cookies
pgv_pvi 645735424
Sessionempty
Server/Request Data
HTTP_HOST localhost
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_UPGRADE_INSECURE_REQUESTS 1
HTTP_COOKIE pgv_pvi=645735424
HTTP_USER_AGENT Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1 Safari/605.1.15
HTTP_ACCEPT_LANGUAGE zh-cn
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_CONNECTION keep-alive
PATH /usr/bin:/bin:/usr/sbin:/sbin
SERVER_SIGNATURE
SERVER_SOFTWARE Apache/2.4.29 (Unix) PHP/7.1.14
SERVER_NAME localhost
SERVER_ADDR ::1
SERVER_PORT 80
REMOTE_ADDR ::1
DOCUMENT_ROOT /Library/WebServer/Documents/tp5/public
REQUEST_SCHEME http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT /Library/WebServer/Documents/tp5/public
SERVER_ADMIN you@example.com
SCRIPT_FILENAME /Library/WebServer/Documents/tp5/public/index.php
REMOTE_PORT 49364
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING
REQUEST_URI /index/index/test
SCRIPT_NAME /index.php
PATH_INFO /index/test
PATH_TRANSLATED /Library/WebServer/Documents/tp5/public/index.php/test
PHP_SELF /index.php/index/test
REQUEST_TIME_FLOAT 1528074339.267
REQUEST_TIME 1528074339
argv []
argc 0
Environment Variables
PATH /usr/bin:/bin:/usr/sbin:/sbin
XPC_SERVICE_NAME 0
XPC_FLAGS 0x80
XPC_SERVICES_UNAVAILABLE 1
ThinkPHP Constants
APP_PATH /Library/WebServer/Documents/tp5/public/../application/
THINK_VERSION 5.0.20
THINK_START_TIME 1528074339.2685
THINK_START_MEM 362624
EXT .php
DS /

THINK_PATH /Library/WebServer/Documents/tp5/thinkphp/

LIB_PATH /Library/WebServer/Documents/tp5/thinkphp/library/

CORE_PATH /Library/WebServer/Documents/tp5/thinkphp/library/think/

TRAIT_PATH /Library/WebServer/Documents/tp5/thinkphp/library/traits/

ROOT_PATH /Library/WebServer/Documents/tp5/

EXTEND_PATH /Library/WebServer/Documents/tp5/extend/

VENDOR_PATH /Library/WebServer/Documents/tp5/vendor/

RUNTIME_PATH /Library/WebServer/Documents/tp5/runtime/

LOG_PATH /Library/WebServer/Documents/tp5/runtime/log/

CACHE_PATH /Library/WebServer/Documents/tp5/runtime/cache/

TEMP_PATH /Library/WebServer/Documents/tp5/runtime/temp/

CONF_PATH /Library/WebServer/Documents/tp5/public/../application/

CONF_EXT .php
ENV_PREFIX PHP_
IS_CLI false
IS_WIN false
ThinkPHP V5.0.20 { 十年磨一剑-为API开发设计的高性能框架 }
  • 写回答

1条回答 默认 最新

  • druzuz321103 2018-10-25 15:16
    关注

    [0] HttpException in App.php line 578 控制器不存在:app\index\controller\Test

    This error means you are trying to access the Test controller which doesn't exist.

    I assume that you want to access the test function in the index controller but you are using a url like yoursite/test.

    If so, you should go to yoursite/index/test to access it.

    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘