Error using FuelPhp in version 7

2

I would like to know if anyone has encountered a similar error when using the FuelPHP framework, in version 1.7 with PHP 7.

You are bursting the following message before entering the application:

  Fatal error: Uncaught Error: Call to undefined method Error::error_handler() in C:\xampp\htdocs\arquivo\fuel\core\bootstrap.php:100 Stack trace: #0 C:\xampp\htdocs\arquivo\fuel\core\bootstrap.php(43): {closure}(8, 'Undefined varia...', 'C:\xampp\htdocs...', 43, Array) #1 [internal function]: {closure}() #2 {main} thrown in C:\xampp\htdocs\arquivo\fuel\core\bootstrap.php on line 100

After logging in:

Fatal error: Uncaught Error: Call to undefined method Error::exception_handler() in C:\xampp\htdocs\arquivo\fuel\core\bootstrap.php:84 Stack trace: #0 [internal function]: {closure}(Object(Fuel\Core\Database_Exception)) #1 {main} thrown in C:\xampp\htdocs\arquivo\fuel\core\bootstrap.php on line 84

Fatal error: Uncaught Error: Call to undefined method Error::error_handler() in C:\xampp\htdocs\arquivo\fuel\core\bootstrap.php:100 Stack trace: #0 C:\xampp\htdocs\arquivo\fuel\core\bootstrap.php(43): {closure}(8, 'Undefined varia...', 'C:\xampp\htdocs...', 43, Array) #1 [internal function]: {closure}() #2 {main} thrown in C:\xampp\htdocs\arquivo\fuel\core\bootstrap.php on line 100

Stacktrace of bootstrap.php

set_exception_handler(function (\Exception $e)
{
    // reset the autoloader
    \Autoloader::_reset();

    // deal with PHP bugs #42098/#54054
    if ( ! class_exists('Error'))
    {
        include COREPATH.'classes/error.php';
        class_alias('\Fuel\Core\Error', 'Error');
        class_alias('\Fuel\Core\PhpErrorException', 'PhpErrorException');
    }

    return \Error::exception_handler($e);
});

set_error_handler(function ($severity, $message, $filepath, $line)
{
    // reset the autoloader
    \Autoloader::_reset();

    // deal with PHP bugs #42098/#54054
    if ( ! class_exists('Error'))
    {
        include COREPATH.'classes/error.php';
        class_alias('\Fuel\Core\Error', 'Error');
        class_alias('\Fuel\Core\PhpErrorException', 'PhpErrorException');
    }

    return \Error::error_handler($severity, $message, $filepath, $line);
});

I came to see this link, but it did not help me much = /

link .

At first the application was mounted upon php 5.6. *.

Database is running all right.

    
asked by anonymous 19.06.2018 / 23:57

1 answer

2

You are using a version of FuelPHP that is not supported for PHP 7.

Upgrade to version 1.8, renaming the class \Fuel\Error to \Fuel\Errorhandler . More details can be found in the changelog of FuelPHP .

    
20.06.2018 / 01:47