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 en-index
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_ 9468
HTTP_CONNECTION close
SCRIPT_NAME /index.php
REQUEST_URI /en-index.html
QUERY_STRING
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/1.1
GATEWAY_INTERFACE CGI/1.1
REDIRECT_URL /en-index.html
REMOTE_PORT 46118
SCRIPT_FILENAME C:/phpstudy_pro/WWW/index.php
SERVER_ADMIN admin@example.com
CONTEXT_DOCUMENT_ROOT C:/phpstudy_pro/WWW
CONTEXT_PREFIX
REQUEST_SCHEME https
DOCUMENT_ROOT C:/phpstudy_pro/WWW
REMOTE_ADDR 52.55.19.189
SERVER_PORT 443
SERVER_ADDR 10.61.86.30
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_HOST www.amftools.com
HTTP_REFERER http://www.amftools.com/en-index.html
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
SSL_SESSION_RESUMED Initial
SSL_SESSION_ID ecbdc5503e6f9f01b7e844d9200e03352004992e083b678cdee6e3c9c9394270
SSL_SERVER_A_SIG sha256WithRSAEncryption
SSL_SERVER_A_KEY rsaEncryption
SSL_SERVER_I_DN CN=Encryption Everywhere DV TLS CA - G2,OU=www.digicert.com,O=DigiCert Inc,C=US
SSL_SERVER_S_DN CN=amftools.com
SSL_SERVER_V_END Apr 16 23:59:59 2024 GMT
SSL_SERVER_V_START Jan 18 00:00:00 2024 GMT
SSL_SERVER_M_SERIAL 0F18B922711D6C45C83C7D68F2249817
SSL_SERVER_M_VERSION 3
SSL_CLIENT_VERIFY NONE
SSL_CIPHER_ALGKEYSIZE 256
SSL_CIPHER_USEKEYSIZE 256
SSL_CIPHER_EXPORT false
SSL_CIPHER TLS_CHACHA20_POLY1305_SHA256
SSL_COMPRESS_METHOD NULL
SSL_SECURE_RENEG true
SSL_PROTOCOL TLSv1.3
SSL_VERSION_LIBRARY OpenSSL/1.1.1b
SSL_VERSION_INTERFACE mod_ssl/2.4.39
SSL_SERVER_SAN_DNS_1 www.amftools.com
SSL_SERVER_SAN_DNS_0 amftools.com
SSL_SERVER_I_DN_CN Encryption Everywhere DV TLS CA - G2
SSL_SERVER_I_DN_OU www.digicert.com
SSL_SERVER_I_DN_O DigiCert Inc
SSL_SERVER_I_DN_C US
SSL_SERVER_S_DN_CN amftools.com
SSL_TLS_SNI www.amftools.com
HTTPS on
REDIRECT_STATUS 200
REDIRECT_SSL_TLS_SNI www.amftools.com
REDIRECT_HTTPS on
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711691196.6454
REQUEST_TIME 1711691196
empty
0. Whoops\Handler\PrettyPageHandler