Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve "Uncaught TypeError" in error handler using CakePHP 2 on PHP7?

Fatal Error

Error: Uncaught TypeError: Argument 1 passed to ErrorHandler::handleException() must be an instance of Exception, instance of Error given in /opt/lampp/htdocs/quiz/lib/Cake/Error/ErrorHandler.php:108 Stack trace: #0 [internal function]: ErrorHandler::handleException(Object(Error)) #1 {main} thrown

File: /opt/lampp/htdocs/quiz/lib/Cake/Error/ErrorHandler.php
Line: 108

I am using cakephp 2.6.1 on php7. I am getting above error. please help me out

like image 558
akshay shringi Avatar asked Jul 18 '16 09:07

akshay shringi


1 Answers

CakePHP 2.8 is compatible with PHP7. CakePHP 2.6 and 2.7 are not. See http://book.cakephp.org/2.0/en/appendices/2-8-migration-guide.html#php7-compatibility

like image 96
Christian Avatar answered Oct 24 '22 00:10

Christian