问题
Fatal error: Uncaught Error: Class 'String' not found in /var/www/html/hrportal/lib/Cake/Utility/Debugger.php:340
Stack trace: 0 /var/www/html/hrportal/lib/Cake/Utility/Debugger.php(742): Debugger::trace(Array)1 /var/www/html/hrportal/lib/Cake/Error/ErrorHandler.php(229): Debugger->outputError(Array) /var/www/html/hrportal/app/Controller/AppController.php(72): ErrorHandler::handleError(8, 'Undefined index...', '/var/www/html/h...', 72, Array) 3 /var/www/html/hrportal/lib/Cake/Event/CakeEventManager.php(243): AppController->beforeFilter(Object(CakeEvent)) 4 /var/www/html/hrportal/lib/Cake/Controller/Controller.php(676): CakeEventManager->dispatch(Object(CakeEvent)) 5 /var/www/html/hrportal/lib/Cake/Error/ExceptionRenderer.php(154): Controller->startupProcess() 6 /var/www/html/hrportal/lib/Cake/Error/ExceptionRenderer.php(92): ExceptionRenderer->_getController(Object(FatalErrorException)) 7 /var/www/html/hrportal/lib/Cake/Error/ErrorHandler.php(126): ExceptionRenderer->__construct(Object(FatalErrorException)) 8 in /var/www/html/hrportal/lib/Cake/Utility/Debugger.php on line340
This error is coming as i have upgraded my system to PHP 7.0.
I have CakePHP application , that was working on 5.5.9 Perfectly , Now this error is coming please help .
回答1:
CakePHP 2.6 is not compatible with PHP 7 https://book.cakephp.org/2.0/en/installation.html
回答2:
try cakephp 2.9 release if you don't want to use 3.x
回答3:
According to Cakephp 2.x documentation. Below are the PHP Requirements for Cakephp 2.x
PHP 5.3.0 or greater (CakePHP version 2.6 and below support PHP 5.2.8 and above). CakePHP version 2.8.0 and above support PHP 7. To use PHP above 7.1 you may need to install mcrypt via PECL. See Security for more information.
回答4:
For PHP 7 you have to use 2.9.x
来源:https://stackoverflow.com/questions/46170214/cakephp-2-6-3-not-working-on-php-7