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\article\controller\ContentController.php:39 #2 app\article\controller\ContentController: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\article\controller\ContentController.php39
2
app\article\controller\ContentController 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\article\controller\ContentController.php
            $this->error404();
        }
        $model = target('ContentArticle');
        //获取内容信息
        if (!empty($contentId)) {
            $contentInfo = $model->getInfo($contentId);
        } elseif (!empty($urlTitle)) {
            $where = [];
            $where['urltitle'] = $urlTitle;
            $contentInfo = $model->getWhereInfo($where);
        } else {
            $this->error404();
        }
        $contentId = $contentInfo['content_id'];
        //信息判断
        if (!is_array($contentInfo)) {
            $this->error404();
        }
        if (!$contentInfo['status']) {
            $this->error404();
        }
        //获取栏目信息
        $modelCategory = target('CategoryArticle');
        $categoryInfo = $modelCategory->getInfo($contentInfo['class_id']);
        if (!is_array($categoryInfo)) {
            $this->error404();
        }
 
        // 多语言
        if (defined('LANG_OPEN') && $categoryInfo['lang'] !== APP_LANG) {
            changeLang($categoryInfo['lang'], $_REQUEST['s']);
        }
 
        if ($categoryInfo['app'] != APP_NAME) {
            $this->error404();
        }
        //判断跳转
        if (!empty($contentInfo['url'])) {
            $link = $this->show($contentInfo['url']);
            $this->redirect($link, 301);
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
class_urlname hunningtugongju
urltitle zhongxingpingtoutieba
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_ 10112
HTTP_CONNECTION close
SCRIPT_NAME /index.php
REQUEST_URI /hunningtugongju/zhongxingpingtoutieba.html
QUERY_STRING
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/1.1
GATEWAY_INTERFACE CGI/1.1
REDIRECT_URL /hunningtugongju/zhongxingpingtoutieba.html
REMOTE_PORT 36414
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 3.237.178.126
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/hunningtugongju/zhongxingpingtoutieba.html
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
SSL_SESSION_RESUMED Initial
SSL_SESSION_ID da59820796bb70419a0682a71c76c40c789dde129f78b64bedebd02ae261f98f
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 1711668953.5204
REQUEST_TIME 1711668953
empty
0. Whoops\Handler\PrettyPageHandler