PHP: Class not found, although file is loaded
Posted: Mon Nov 28, 2016 2:02 am
[PROBLEM]
Instantiating a class, gives me the following error - although the class file is loaded:
Check if if the class name defined in its file is actually correct.
In my case, the error was similar to:
As you see, there's a typo in "MyClass.php":
The name "MyClasss" does not match "MyClass".
Instantiating a class, gives me the following error - although the class file is loaded:
[SOLUTION]PHP Fatal error: Class 'MyClass' not found in MyClass.php on line 13
Check if if the class name defined in its file is actually correct.
In my case, the error was similar to:
Code: Select all
class MyClasss
{
...
}
The name "MyClasss" does not match "MyClass".