"Class "X" not found" in PHP — What It Means and How to Fix It
What the PHP error "Class "X" not found" means and how to fix it.
Published October 31, 2026
"Class "X" not found" occurs when code references a class that hasn't been defined or properly autoloaded.
Key points
- Check the namespace and use statement match exactly, and that Composer's autoloader is up to date (composer dump-autoload)