0

I just installed xampp with php 7.0.4 and a fresh cakephp 3.2.6. I did a lot of research and everything I found shows that they are compatible.

However as soon as I go to open the application with a browser, cake replies with an Internal Error.

The only pointer as to what to do is that xampp logs the following in apache error.log:

PHP Fatal error: Uncaught TypeError: Argument 1 passed to Cake\Error\BaseErrorHandler::handleException() must be an instance of Exception, instance of Error given in D:\Xampp\htdocs\cakephp\vendor\cakephp\cakephp\src\Error\BaseErrorHandler.php:153
Stack trace:
#0 [internal function]: Cake\Error\BaseErrorHandler->handleException(Object(Error))
#1 {main} thrown in D:\Xampp\htdocs\cakephp\vendor\cakephp\cakephp\src\Error\BaseErrorHandler.php on line 153

I tried php 5.6 but it still shows the error in the log.

ndm
  • 59,784
  • 9
  • 71
  • 110

1 Answers1

2

If that's the error that you are encountering, then I'd doubt that you are using CakePHP 3.2.6, as line 153 is in the middle of a comment

https://github.com/cakephp/cakephp/blob/3.2.6/src/Error/BaseErrorHandler.php#L153

PHP7 errors are handled since CakePHP 3.1.5, so check your CakePHP dependency, and make sure it's actually up to date.

ndm
  • 59,784
  • 9
  • 71
  • 110
  • I'm getting the same error with PHP 7.0.5 (my own build). I downloaded the file [cakephp-3-2-6.zip](https://github.com/cakephp/cakephp/releases/download/3.2.6/cakephp-3-2-6.zip) from the releases page. Line 153 points to handleException function signature. – expora Apr 03 '16 at 10:05
  • No problems through the composer method, though. I compared the files with `diff` and are not the same. – expora Apr 03 '16 at 10:21
  • 1
    @expora There seems to be something wrong with the package, it actually contains version 3.0.18 – ndm Apr 03 '16 at 13:00
  • 1
    Jep, the package has been fixed **https://github.com/cakephp/cakephp/issues/8585** @expora – ndm Apr 04 '16 at 00:18
  • Thanks a lot everyone. Turns the files on the cakephp site were actually an older version as @ndm said. After downloading from github everything worked – Arthur Gurjinyan Apr 04 '16 at 11:44