Hi There,
I work at a school and we have a Yii app to manage kids assignments. We just transferred it over to a new server, setup the new database. We have made the /backed/web/assets folder writable by the apache process.
We are still getting a PHP error and we can’t figure out what we are doing wrong. Can anyone please help us.
–
Error
PHP Notice – yii\base\ErrorException
Undefined variable: url
- in /var/www/html/innerdesk/backend/themes/emphes/layouts/main.php at line 84
75767778798081828384858687888990919293 </div>
<!-- end: SEARCH FORM -->
<!-- start: USER OPTIONS -->
<div class="nav-user-wrapper">
<div class="media">
<div class="media-left">
<? $model = \common\models\Profile::findOne(['pUser'=>Yii::$app->user->id]);
$url = isset($model->photo)? Yii::getAlias('@web/uploads/').$model->photo :$this->theme->baseUrl."/assets/images/avatar-1.jpg";
?>
<a class="profile-card-photo" href="#"><img alt="" src="<?php echo $url ?>"></a>
</div>
<div class="media-body">
<span class="media-heading text-white"><?= Yii::$app->user->identity->username?></span>
<div class="text-small text-white-transparent">
</div>
</div>
<div class="media-right media-middle">
- in /var/www/html/innerdesk/backend/themes/emphes/layouts/main.php at line 84 – yii\base\ErrorHandler::handleError(8, ‘Undefined variable: url’, ‘/var/www/html/innerdesk/backend/…’, 84, …)
78798081828384858687888990 <div class="nav-user-wrapper">
<div class="media">
<div class="media-left">
<? $model = \common\models\Profile::findOne(['pUser'=>Yii::$app->user->id]);
$url = isset($model->photo)? Yii::getAlias('@web/uploads/').$model->photo :$this->theme->baseUrl."/assets/images/avatar-1.jpg";
?>
<a class="profile-card-photo" href="#"><img alt="" src="<?php echo $url ?>"></a>
</div>
<div class="media-body">
<span class="media-heading text-white"><?= Yii::$app->user->identity->username?></span>
<div class="text-small text-white-transparent">
-
in /var/www/html/innerdesk/vendor/yiisoft/yii2/base/View.php at line 326 – require(’/var/www/html/innerdesk/backend/…’)
-
in /var/www/html/innerdesk/vendor/yiisoft/yii2/base/View.php at line 248 – yii\base\View::renderPhpFile(’/var/www/html/innerdesk/backend/…’, [‘content’ => ‘<div class="container-fluid cont…’])
-
in /var/www/html/innerdesk/vendor/yiisoft/yii2/base/Controller.php at line 393 – yii\base\View::renderFile(’/var/www/html/innerdesk/backend/…’, [‘content’ => ‘<div class="container-fluid cont…’], backend\controllers\SiteController)
-
in /var/www/html/innerdesk/vendor/yiisoft/yii2/base/Controller.php at line 379 – yii\base\Controller::renderContent(’<div class="container-fluid cont…’)
-
in /var/www/html/innerdesk/backend/controllers/SiteController.php at line 161 – yii\base\Controller::render(‘index’, [‘searchModel’ => backend\models\AssetSchoolSearch, ‘dataProvider’ => yii\data\ActiveDataProvider, ‘searchModel1’ => backend\models\StudentSearch, ‘dataProvider1’ => yii\data\ActiveDataProvider, …])
155156157158159160161162163164165166167 ‘data’=>$this->filterDashboard($dashboard),
'loandataProvider' => $loandataProvider,
'ticketdataProvider' => $ticketdataProvider,
'jobdataProvider' => $jobdataProvider,
'staffdataProvider' => $staffdataProvider,
'teacherdataProvider' => $teacherdataProvider,
'studentprovider'=>isset($studentprovider)?$studentprovider:'',
]);
}
else{
$searchModel = new AssetSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
-
backend\controllers\SiteController::actionIndex()
-
in /var/www/html/innerdesk/vendor/yiisoft/yii2/base/InlineAction.php at line 55 – call_user_func_array([backend\controllers\SiteController, ‘actionIndex’], [])
-
in /var/www/html/innerdesk/vendor/yiisoft/yii2/base/Controller.php at line 154 – yii\base\InlineAction::runWithParams([])
-
in /var/www/html/innerdesk/vendor/yiisoft/yii2/base/Module.php at line 454 – yii\base\Controller::runAction(’’, [])
-
in /var/www/html/innerdesk/vendor/yiisoft/yii2/web/Application.php at line 100 – yii\base\Module::runAction(’’, [])
-
in /var/www/html/innerdesk/vendor/yiisoft/yii2/base/Application.php at line 375 – yii\web\Application::handleRequest(yii\web\Request)
-
in /var/www/html/innerdesk/backend/web/index.php at line 18 – yii\base\Application::run()
12131415161718 require(DIR . ‘/../../common/config/main-local.php’),
require(__DIR__ . '/../config/main.php'),
require(__DIR__ . '/../config/main-local.php')
);
$application = new yii\web\Application($config);
$application->run();
$_COOKIE = [
'PHPSESSID' => 'l6s2llj1tplkp7f9r4p8uaids3',
'_identity' => '3fc2e541bc8025699e021ec9f282795af45654eae9a1e1bc52c36481bfa5f580a:2:{i:0;s:9:"_identity";i:1;s:47:"[69,"vZ6dSkmP7B9rBzLUnjeyzft9kOV4lPY_",2592000]";}',
'_csrf' => '91c59440432f33a28f6a12e02d04cb1ae65cda1903340f78cf324c0e7cb1dc48a:2:{i:0;s:5:"_csrf";i:1;s:32:"7gjXrS6goe5gXhTMwf60do08Yo9z_YNC";}',
];
$_SESSION = [
'__flash' => [],
'__returnUrl' => '/innerdesk/backend/web/index.php',
'__id' => 69,
];
Yii Framework
2017-02-04, 08:58:12
Apache/2.4.6 (CentOS) PHP/7.0.15
Yii Framework/2.0.10
Warning: file_put_contents(/var/www/html/innerdesk/backend/runtime/debug/589597a40cde1.data): failed to open stream: Permission denied in /var/www/html/innerdesk/vendor/yiisoft/yii2-debug/LogTarget.php on line 57
Warning: touch(): Utime failed: Permission denied in /var/www/html/innerdesk/vendor/yiisoft/yii2-debug/LogTarget.php on line 75