Deploy from local host to server

I have develooped a website with yii2 advanced template, however when i copy all project to my server , i got this error when try to signup or add new record

PHP Warning – yii\base\ErrorException

Invalid argument supplied for foreach()

Detail as follow :

Please someone tell me why i got this error and how to fix this please ?

 3. in C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\db\ActiveQueryTrait.php – yii\db\BaseActiveRecord::populateRecord(common\models\Vbpl, null) at line 132

$rows is null for some reason when populateRecord is called.

I think the record is not found.

You either forgot to migrate your data on the server, some master table which is always populated, or you must handle the case in which the query return an empty dataset.

The problem should be here:

public static function populateRecord($record, $row)


    $columns = array_flip($record->attributes());

    foreach ($row as $name => $value) {


$record->attributes(), I guess in some cases does not return and array, maybe in case of empty dataset.

Check what is in $record->attributes()