I have a class file: class_xx.php. And then a function file: function_xxx.php
In my function_xxx.php:
require_once('class_xx.php')
... // after few next lines
$object = new class_xx1($arg1, $arg2);
But it gives me:
Fatal error: Class ‘class_xx1’ not found in “some_path” on line “1XX3”
[sorry I can’t exposed the codes yet], any idea why I included the file > require_once with no error, but it gives me “Class not found error”??
Chances are you misspelled the class declaration or something to that avail. You will what to double-check that your spell it the exact same way, with the same casing.
If you are developing on a secondary sever, you might have not transferred the completed
class_xxx.phpfile over and just a blank file, in which case PHP would be including a blank file.By the way, you forgot a semi-colon after the
require_once