Class 'app\models\yii\db\ActiveRecord' not found


I have just tried installing the basic Yii on a server and it all worked fine until I tried anything, in particular using the DB connectivity, script wise it really is very simple, I think the issue is to do with the location of files but I cannot figure out why. I have attached the error I get below, I did try adding more of the logs but get told my post is spam.

My installation is located in /var/www/basic/web and doc_root is var/www or var/www/basic/web the results for both are the same

PHP Fatal Error – yii\base\ErrorException

Class ‘app\models\yii\db\ActiveRecord’ not found

  1. in /var/www/basic/models/Generic.php at line 13

namespace app\models;

use yii\db\ActiveRecord;

Do you by any chance have something like this?

class Generic extends yii\db\ActiveRecord

1 Like

Thanks, yes that was it took out the yii\db\ and it worked. Not sure why I added that!