Exception (404)
404页面不存在! Exception thrown with message "404页面不存在!" Stacktrace: #4 Exception in C:\phpstudy_pro\WWW\app\base\controller\BaseController.php:183 #3 app\base\controller\BaseController:error404 in C:\phpstudy_pro\WWW\app\page\controller\CategoryController.php:40 #2 app\page\controller\CategoryController:index in C:\phpstudy_pro\WWW\framework\base\App.php:68 #1 framework\base\App:run in C:\phpstudy_pro\WWW\framework\core.php:125 #0 require in C:\phpstudy_pro\WWW\index.php:8
Stack frames (5)
4
Exception
…\app\base\controller\BaseController.php183
3
app\base\controller\BaseController error404
…\app\page\controller\CategoryController.php40
2
app\page\controller\CategoryController index
…\framework\base\App.php68
1
framework\base\App run
…\framework\core.php125
0
require
…\index.php8
C:\phpstudy_pro\WWW\app\base\controller\BaseController.php
     * @param bool   $status  状态
     * @param string $jumpUrl 跳转地址
     *
     * @return array
     */
    public function ajaxReturn($data)
    {
        header('Content-type:text/json');
        echo json_encode($data);
        exit;
    }
 
    /**
     * 页面不存在.
     *
     * @return array 页面信息
     */
    protected function error404()
    {
        throw new \Exception('404页面不存在!', 404);
    }
 
    /**
     * 通讯错误.
     */
    protected function errorBlock()
    {
        $this->error('通讯发生错误,请稍后刷新后尝试!');
    }
 
    //生成分页URL
    protected function createPageUrl($paramer = [], $mustParams = [], $page = 1)
    {
        $paramer = array_filter($paramer);
        $paramer = array_flip(array_flip($paramer));
        $dir = APP_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME;
        $mustParams['page'] = $page;
 
        return match_url($dir, $paramer, $mustParams);
    }
C:\phpstudy_pro\WWW\app\page\controller\CategoryController.php
        }
        //获取栏目信息
        $model = target('Page/CategoryPage');
        if (!empty($classId)) {
            $categoryInfo = $model->getInfo($classId);
        } elseif (!empty($urlName)) {
            $map = [];
            $map['urlname'] = $urlName;
            $categoryInfo = $model->getWhereInfo($map);
        } else {
            $this->error404();
        }
 
        $classId = $categoryInfo['class_id'];
        //信息判断
        if (!is_array($categoryInfo)) {
            $this->error404();
        }
        if ($categoryInfo['app'] != APP_NAME) {
            $this->error404();
        }
        //位置导航
        $crumb = target('duxcms/Category')->loadCrumb($classId);
        //内容处理
        $categoryInfo['content'] = html_out($categoryInfo['content']);
        //查询上级栏目信息
        $parentCategoryInfo = target('duxcms/Category')->getInfo($categoryInfo['parent_id']);
        //获取顶级栏目信息
        $topCategoryInfo = target('duxcms/Category')->getInfo($crumb[0]['class_id']);
        //MEDIA信息
        $media = $this->getMedia($categoryInfo['name'], $categoryInfo['keywords'], $categoryInfo['description']);
        //模板赋值
        $this->assign('categoryInfo', $categoryInfo);
        $this->assign('parentCategoryInfo', $parentCategoryInfo);
        $this->assign('topCategoryInfo', $topCategoryInfo);
        $this->assign('crumb', $crumb);
        $this->assign('media', $media);
        $this->siteDisplay($categoryInfo['class_tpl']);
    }
}
C:\phpstudy_pro\WWW\framework\base\App.php
 
            if (defined('API_STATUS')) {
                $controller = '\\app\\api\\controller\\IndexController';
                $action = 'index';
            } else {
                $controller = '\app\\'.APP_NAME.'\controller\\'.CONTROLLER_NAME.'Controller';
                $action = ACTION_NAME;
            }
            //execute action
 
            if (!class_exists($controller)) {
                throw new \Exception("Controller '{$controller}' not found", 404);
            }
            $obj = new $controller();
            if (!method_exists($obj, $action)) {
                throw new \Exception("Action '{$controller}::{$action}()' not found", 404);
            }
 
            Hook::listen('actionBefore', [$obj, $action]);
            $obj->$action();
            Hook::listen('actionAfter', [$obj, $action]);
        } catch (\Exception $e) {
            // //关闭调试或者是线上版本,不显示详细错误
            // if (false==config('DEBUG') || 'production' == config('ENV')) {
            //     $home = new \app\home\controller\IndexController();
            //     $home->error404();
            // } else {
            //     throw $e;
            // }
            Hook::listen('appError', [$e]);
        }
 
        Hook::listen('appEnd');
    }
}
 
C:\phpstudy_pro\WWW\framework\core.php
                foreach (glob($fileDIR.'*.php') as $file) {
                    $fileList[$fileDIR][] = $file;
                }
            }
 
            $fileBase = $baseDir.str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR.$className;
            foreach ($fileList[$fileDIR] as $file) {
                if (false !== stripos($file, $fileBase)) {
                    require $file;
 
                    return true;
                }
            }
        }
    }
 
    return false;
});
 
App::run();
 
C:\phpstudy_pro\WWW\index.php
<?php
 
if (version_compare(PHP_VERSION, '5.6.0', '<')) {
    header('Content-Type: text/html; charset=UTF-8');
    echo 'PHP环境不能低于5.6';
    exit;
}
require 'framework/core.php';
 

Environment & details:

Key
Value
urlname
contact
empty
empty
empty
empty
Key
Value
PATH
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
SYSTEMROOT
C:\Windows
COMSPEC
C:\Windows\system32\cmd.exe
PATHEXT
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINDIR
C:\Windows
PHPRC
C:/phpstudy_pro/Extensions/php/php7.3.4nts
_FCGI_SHUTDOWN_EVENT_
10404
HTTP_CONNECTION
close
SCRIPT_NAME
/index.php
REQUEST_URI
/contact.html
QUERY_STRING
REQUEST_METHOD
GET
SERVER_PROTOCOL
HTTP/1.1
GATEWAY_INTERFACE
CGI/1.1
REDIRECT_URL
/contact.html
REMOTE_PORT
20000
SCRIPT_FILENAME
C:/phpstudy_pro/WWW/index.php
SERVER_ADMIN
admin@example.com
CONTEXT_DOCUMENT_ROOT
C:/phpstudy_pro/WWW
CONTEXT_PREFIX
REQUEST_SCHEME
http
DOCUMENT_ROOT
C:/phpstudy_pro/WWW
REMOTE_ADDR
154.92.207.131
SERVER_PORT
80
SERVER_ADDR
123.58.6.54
SERVER_NAME
www.amftools.com
SERVER_SOFTWARE
Apache/2.4.39 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9a mod_log_rotate/1.02
SERVER_SIGNATURE
SystemRoot
C:\Windows
HTTP_ACCEPT_ENCODING
deflate, gzip
HTTP_ACCEPT
*/*
HTTP_HOST
www.amftools.com
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
REDIRECT_STATUS
200
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1597196744.4548
REQUEST_TIME
1597196744
empty
0. Whoops\Handler\PrettyPageHandler