We have a vagrant setup for our magento 2 project. We have some custom modules in our setup. So on one linux machine there is no issue at all as we have same code (using git). But on mac machine same vagrant setup we are getting issue class do not exist while it does.

Exception #0 (InvalidArgumentException): Plugin class Magefan\LoginAsCustomer\Model\PageCache\ConfigPlugin doesn't exist

So you can see above exception for example while we have ConfigPlugin class file on right location. There is no issue when I am running setup:upgrade and setup:di:compile command mean there is no issue to generate file in pub folder.

And I have one more extension where magento redirecting on 404 page while on same url there is no issue on other linux machine. So after debugging the code I found magento is not able to found controller class file. Magento is able to read router.xml file but when it check controller class in following condition it return null.

is_subclass_of($this->actions[$fullPath], $this->actionInterface) ? $this->actions[$fullPath] : null;

So when I did var_dump on this full path $this->actions[$fullPath] then I can see the full path of controller file but if I check following condition in var_dump then it print false.

var_dump(class_exists($this->actions[$fullPath], true) );

So this mean magento is not able to find controller class file while it exist.

Please let me know if anyone faced same issue.

  • Check permission – Sohel Rana Feb 17 '17 at 16:00
  • first all file have same permission why only some specific file will create issue, second I have given 777 on full app/code folder so permission should not be an issue – Saurabh Feb 17 '17 at 16:05
  • Any symlinks used in the folders? – Zefiryn Feb 17 '17 at 19:43
  • there are no symlink – Saurabh Feb 18 '17 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.