Skip to content

__autoload() is deprecated, use spl_autoload_register() instead in app/code/core/Mage/Core/functions.php on line 61

In Magento 1.9.3.x..we have upgrade php version from 5.6 to 7.3.after that we are facing issue like

Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in app/code/core/Mage/Core/functions.php on line 61 . function look like below

function __autoload($class)
{

if (defined('COMPILER_INCLUDE_PATH')) {
    $classFile = $class.'.php';
} else {
    $classFile = uc_words($class, DIRECTORY_SEPARATOR).'.php';
}

include($classFile);

}

we have replace with

function spl_autoload_register($class)
{

if (defined('COMPILER_INCLUDE_PATH')) {
    $classFile = $class.'.php';
} else {
    $classFile = uc_words($class, DIRECTORY_SEPARATOR).'.php';
}

include($classFile);

}

But again it throws an fetal error like
Fatal error: Cannot redeclare spl_autoload_register() in app/code/core/Mage/Core/functions.php on line 71

Please help me…my live site is not working because of this upgradation..