I just upgraded to PHP 7 and got this exception when accessing the backend
Uncaught TypeError: Argument 1 passed to October\Rain\Foundation\Exception\Handler::report() must be an instance of Exception, instance of Error given, called in
october/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 73 and defined in
october/vendor/october/rain/src/Foundation/Exception/Handler.php:42
Stack trace:
#0 october/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(73): October\Rain\Foundation\Exception\Handler->report(Object(Error))
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Error))
#2 {main} thrown
I will try an upgrade on my installation.
I'll have a look at this at some later point. But it clearly looks like an incompatibility with the new PHP7 Exceptions
https://wiki.php.net/rfc/throwable-interface
Here is the pull request that solved compatibility with exception handling for Symfony2
https://github.com/symfony/symfony/pull/14959
More than likely this was fixed in Laravel 5.1
If October is PHP7 compatible, it will be super fast. Thanks @daftspunk!
Let see, there is
laravel/framework#9664 wich should resolve, and
laravel/framework#9602
One thing i'm not sure, is if it is compatible with October. I will do some test to find out.
Just developed this workaround to get things running on my development environment, for production 'll wait for official full support, that means supporting Laravel 5.1 (?).
class Plugin extends PluginBase
{
public function register()
{
set_exception_handler([$this, 'handleException']);
}
public function handleException($e)
{
if (! $e instanceof Exception) {
$e = new \Symfony\Component\Debug\Exception\FatalThrowableError($e);
}
$handler = $this->app->make('Illuminate\Contracts\Debug\ExceptionHandler');
$handler->report($e);
if ($this->app->runningInConsole()) {
$handler->renderForConsole(new ConsoleOutput, $e);
} else {
$handler->render($this->app['request'], $e)->send();
}
}
Laravel 5.2 will also get released pretty soon
Laravel 5.2 was released. I suppose this issue can be updated soon?
i use octoberCMS for my personal sites. So far no problem with php7.
I have tested with XAMPP 7.0 and no problem for now. @daftspunk , @JoelESvensson what problem have you got?
The only place I see is on running php artisan serve
Fixed by, duplicate of #1645
@daftspunk It cannot be a duplicate, it was created before!
I still get this error after creating a new plugin.
I have an issue with php artisan tinker on php7 I believe this was fixed for 5.2
We're sorry, but an unhandled error occurred. Please see the details below.
Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128'
public_html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php line 16
:disappointed: after moved to another server, which is used 7.0.8. From apache to nginx. Waiting for stable release!
Try installing the php-mcrypt extension.
Nikita [email protected] schrieb am Sa., 2. Juli 2016, 19:27:
We're sorry, but an unhandled error occurred. Please see the details below.
Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed
'MCRYPT_RIJNDAEL_128'
public_html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php
line 16
😞 after moved to another server, which is used 7.0.8. From apache to
nginx. Waiting for stable release!—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/octobercms/october/issues/1636#issuecomment-230112927,
or mute the thread
https://github.com/notifications/unsubscribe/AIM53YjgcgmsmYIV9dhCOd1bv3eT873Oks5qRp98gaJpZM4GuW8A
.
Just developed this workaround to get things running on my development environment, for production 'll wait for official full support, that means supporting Laravel 5.1 (?).
class Plugin extends PluginBase { public function register() { set_exception_handler([$this, 'handleException']); } public function handleException($e) { if (! $e instanceof Exception) { $e = new \Symfony\Component\Debug\Exception\FatalThrowableError($e); } $handler = $this->app->make('Illuminate\Contracts\Debug\ExceptionHandler'); $handler->report($e); if ($this->app->runningInConsole()) { $handler->renderForConsole(new ConsoleOutput, $e); } else { $handler->render($this->app['request'], $e)->send(); } }
I've recently met this issue on OctoberCMS Build 209 (yes we're still running this, don't ask why...), your answer helped but for me this fixed it:
public function handleException($e){
\Log::error($e);
if ($this->app->runningInConsole()) {
die($e);
}
}
@iwsmike yikes, 209? I'd be interested in helping you upgrade to the latest version purely out of curiosity to see how easy it is or not. Let me know if you're interested in that.
@iwsmike yikes, 209? I'd be interested in helping you upgrade to the latest version purely out of curiosity to see how easy it is or not. Let me know if you're interested in that.
Hi Luke! I think, pretty difficult if not impossible as it was "customized" by different "coders" before i got to the company a couple of years ago... I recently managed to make it run on PHP 7.2.11 instead of 5.6.40, this was annoying but now i face other issues like we are using some third parties tools such as ElasticSearch and also an old version 1.7.5... the upgrade is currently impossible because it'd require us to develop a new class, the current one is made to work with 1.7.5 and this particular version of OctoberCMS and laravel. New version of the class we are using exist but they are for new versions of OctoberCMS and require i think at least laravel 5.5 and are for much newer version of ElasticSearch. Then there's also the problem of the encryption in the database, currently still using mcrypt, i've started looking at OpenSSL as a replacement but I don't have the time... my next goal is first to get ride of ElasticSearch, because the implementation that was made of it is completely useless as every search made on the site are done through ES and then the same is verified in the database... I went from a single VM handling all processes with Apache 2 and an old MySQL to a multi server system with replications and PHP 7.2.11 under NginX with MariaDB.
Anyway, happy to exchange though.
@iwsmike hit me up on Slack or Discord and we can chat. I've had to deal with similar messes before
Most helpful comment
I still get this error after creating a new plugin.