DEV Community

Discussion on: php - How to fix "Class '' not found" error

Collapse
 
marioaprea profile image
marioaprea

I had problem with new classes in my project. I created two classes but when I load Controller from browser the browser answer me:

Fatal error: Uncaught Error: Class '......\CompanyTotals\CompanyTotals' not found in /var/www/html/...../Wallet/WalletFactory.php on line 206

If i launch in project folder the command:

composer install

or

sudo php vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php

When i launch the app from browser it works well only for first load of the page, than the second time gives me the error back.

Can you help me with this problem?

The permission on project is for the major of the file root root, in the app folder, the file bootstrap.php.cache can be created as root root if i use sudo on composer install or mario mario, if i use command without sudo.

The results is the same.