Problem with PHP clases

Hy i have problem with auto load classes on localhost everything is ok, but when i upload my project to server(I use 000webhost free) i have error, can’t recognize classes. I use required_once.
I get message “Fatal error: Class ‘Core’ not found in /home/a4899216/public_html/index.php on line 9”
In index page is this code:

<?php 
//load classes
require_once 'inc/autoload.php';
//instatiate Core class
$core = new Core();
$core->run();

?>

In autoload.php code is:

<?php
function __autoload($class_name)
{
    try 
    {
        $class_file = 'classes/'. strtolower($class_name).'.php';
        if(is_file($class_file))
        {
            require_once $class_file;
        }
        else 
        {
            throw new Exception("Unable to load class $class_name in file $class_file.");
        }
    }
    catch (Exception $e)
    {
        $e->getMessage();
    }
}
?>

Where’s the problem?

Most likely it’s because this is a relative path, so your autoload script checks paths relative to its own location. Quick fix to try instead:

$class_file = __DIR__.'/../classes/'. strtolower($class_name).'.php';

please just use composer :smiley: dont build custom autoloader

I solve problem problem was my classes are with uppercase first letter and i put strtolower,.
this is the write code now it’s work my bad sorry
$class_file = ‘classes/’.$class_name.‘.php’;