-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server Upgraded to PHP7 Error: __toString() must not throw an exception #703
Comments
Any answer? I have similar problem... |
@Pantela777 Kohana is no longer maintained, so there will be no PHP7 support. |
But to fix your problem if you want to update the core yourself, change the
exception in the elseif to return false instead maybe.
…On 16 Oct. 2017 8:43 am, "Alex Belov" ***@***.***> wrote:
Any answer? I have similar problem...
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#703 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADtzk-g_wBUQP-_enAlzxfJ0vxPnhW6Kks5ssnxlgaJpZM4L0i5O>
.
|
I fixed this by changing the catch in the __toString function in system/classes/Kohana/View.php to
in PHP7, fatal and recoverable errors extend a new Error class instead of of the Exception class. I found the explanation on this blog: https://www.aurigait.com/blog/fatal-error-handling-in-php-7/ -- Edited to change catch (Error $e) to catch (Throwable $e) since ErrorExcecptions were causing the toString problem with catch Error. https://trowski.com/2015/06/24/throwable-exceptions-and-errors-in-php7/ |
ErrorException [ Fatal Error ]: Method View::__toString() must not throw an exception, caught ParseError: syntax error, unexpected 'else' (T_ELSE)
The text was updated successfully, but these errors were encountered: