0

I have the following class on my root magento2 directory: test();

PHP storm can link to the MagentoU\test class, so the path is correct and the class exists, but I get the following error when I ran the file in the browser or in the command line I get the following: Fatal error: Uncaught Error: Class 'Training\Unit2\MagentoU\test' not found in C:\xampp\htdocs\magento2\Unit1_162test.php on line 3

So it looks like phpStorm finds the class but magento/php dont?

I'm using magento EE 2.1 in an XAMPP installation

I have tried to add a '\' at the beginning of the use statement and to call directly to the class as 'new Training\Unit2\MagentoU\test', same results.

1 Answer 1

1

Check to make sure that the created class/files have at least the same level of access to the Magento files/folders as the rest. A lot of times, when everything seems to be correct but a module still doesn't work, it usually means there's something wrong with the actual permissions/ownership of the files.

2
  • Thanks, I checked it and it has the same permissions as other files...completely lost with this.... Commented Mar 31, 2017 at 13:55
  • I think that this is just not possible in Magento, ie refer to a module class from the Magento root directory. Commented Apr 3, 2017 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.