I'm having an error using autoloader.
Autoloader.php file:
<?php
function carregarClasses($classe) {
require_once __DIR__ . '/' . $classe . '.php';
}
spl_autoload_register('carregarClasses');
Error:
Warning: require_once (/home/neowix/public_html/erp/pages/classes/Conexao.php): failed to open stream: No such file or directory in /home/neowix/public_html/erp/pages/classes/autoload.php on line 4
Fatal error: require_once (): Failed opening required '/home/neowix/public_html/erp/pages/classes/Conexao.php' (include_path = '.: / opt / php56 / lib / php') in /home/neowix/public_html/erp/pages/classes/autoload.php on line 4