ErrorHandler::handleException(对象(致命错误异常))

ErrorHandler::handleException(Object(FatalErrorException))

Php Cake Error on 7.3.33

PHP 7.3.33 (cli) (built: Nov 16 2021 11:18:28) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.33, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.33, Copyright (c) 1999-2018, by Zend Technologies





Fatal error: Uncaught Error: Class 'Controller' not found in /var/www/html/mobileapp_api/lib/Cake/Error/ExceptionRenderer.php:174
Stack trace:
#0 /var/www/html/mobileapp_api/lib/Cake/Error/ExceptionRenderer.php(92): ExceptionRenderer->_getController(Object(FatalErrorException))
#1 /var/www/html/mobileapp_api/lib/Cake/Error/ErrorHandler.php(126): ExceptionRenderer->__construct(Object(FatalErrorException))
#2 /var/www/html/mobileapp_api/lib/Cake/Error/ErrorHandler.php(284): ErrorHandler::handleException(Object(FatalErrorException))
#3 /var/www/html/mobileapp_api/lib/Cake/Error/ErrorHandler.php(213): ErrorHandler::handleFatalError(64, 'Cannot use 'Obj...', '/var/www/html/m...', 30)
#4 /var/www/html/mobileapp_api/lib/Cake/Core/App.php(970): ErrorHandler::handleError(64, 'Cannot use 'Obj...', '/var/www/html/m...', 30, Array)
#5 /var/www/html/mobileapp_api/lib/Cake/Core/App.php(943): App::_checkFatalError()
#6 [internal function]: App::shutdown()
#7 {main} thrown in /var/www/html/mobileapp_api/lib/Cake/Error/ExceptionRenderer.php on line 174

似乎找不到控制器 class。检查你是否看到 Controller.php 变成

vendor/cakephp/cakephp/src/Controller/Controller.php

如果没有,请尝试删除供应商文件夹并再次 运行 composer install

我尝试安装 composer 但出现类似这样的错误

Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - phpunit/phpunit is locked to version 3.7.38 and an update of this package was not requested.
    - phpunit/phpunit 3.7.38 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.

To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php.ini
    - /etc/php.d/10-opcache.ini
    - /etc/php.d/20-bz2.ini
    - /etc/php.d/20-calendar.ini
    - /etc/php.d/20-ctype.ini
    - /etc/php.d/20-curl.ini
    - /etc/php.d/20-exif.ini
    - /etc/php.d/20-fileinfo.ini
    - /etc/php.d/20-ftp.ini
    - /etc/php.d/20-gd.ini
    - /etc/php.d/20-gettext.ini
    - /etc/php.d/20-iconv.ini
    - /etc/php.d/20-json.ini
    - /etc/php.d/20-mysqlnd.ini
    - /etc/php.d/20-pdo.ini
    - /etc/php.d/20-phar.ini
    - /etc/php.d/20-sockets.ini
    - /etc/php.d/20-sqlite3.ini
    - /etc/php.d/20-tokenizer.ini
    - /etc/php.d/30-mcrypt.ini
    - /etc/php.d/30-mysqli.ini
    - /etc/php.d/30-pdo_mysql.ini
    - /etc/php.d/30-pdo_sqlite.ini
    - /etc/php.d/30-zip.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-dom` to temporarily ignore these required extensions.

我尝试使用 --ignore-platform-req=ext-dom 但同样的错误问题