Magento – Magento 2 PHP Fatal error: Class not found when compiling

magento-enterprisemagento2setup-di-compile

When I compile I get this error:

PHP Fatal error: Class
'Magento\Catalog\Controller\Adminhtml\Category\Image\Upload' not found
in
/var/www/html/magento/app/code/Plazathemes/Override/Controller/Adminhtml/Category/Image/Upload.php
on line 11

EDIT with the code:

enter image description here

Still unable to fix can someone write the soltion to fix this.

Best Answer

Seem that you're trying to override the class Magento\Catalog\Controller\Adminhtml\Category\Image\Upload. So, make sure your custom class will extend from this class.

class Upload extends \Magento\Catalog\Controller\Adminhtml\Category\Image\Upload {
   ......
}