Yii Framework Forum: help me - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

help me I have following errors Rate Topic: -----

#1 User is offline   jack5505 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 22-October 17

Posted 22 October 2017 - 01:46 AM

in C:\xampp\htdocs\project\yii-basic-app-2.0.12\basic\vendor\yiisoft\yii2\db\Connection.php at line 584
575576577578579580581582583584585586587588589590591592593

$token = 'Opening DB connection: ' . $this->dsn;
try {
Yii::info($token, __METHOD__);
Yii::beginProfile($token, __METHOD__);
$this->pdo = $this->createPdoInstance();
$this->initConnection();
Yii::endProfile($token, __METHOD__);
} catch (\PDOException $e) {
Yii::endProfile($token, __METHOD__);
throw new Exception($e->getMessage(), $e->errorInfo, (int) $e->getCode(), $e);
}
}

/**
* Closes the currently active DB connection.
* It does nothing if the connection is already closed.
*/
public function close()
{

2. in C:\xampp\htdocs\project\yii-basic-app-2.0.12\basic\vendor\yiisoft\yii2\db\Connection.php at line 928 – yii\db\Connection::open()
3. in C:\xampp\htdocs\project\yii-basic-app-2.0.12\basic\vendor\yiisoft\yii2\db\Connection.php at line 915 – yii\db\Connection::getMasterPdo()
4. in C:\xampp\htdocs\project\yii-basic-app-2.0.12\basic\vendor\yiisoft\yii2\db\Command.php at line 219 – yii\db\Connection::getSlavePdo()
5. in C:\xampp\htdocs\project\yii-basic-app-2.0.12\basic\vendor\yiisoft\yii2\db\Command.php at line 910 – yii\db\Command::prepare(true)
6. in C:\xampp\htdocs\project\yii-basic-app-2.0.12\basic\vendor\yiisoft\yii2\db\Command.php at line 362 – yii\db\Command::queryInternal('fetchAll', null)
7. in C:\xampp\htdocs\project\yii-basic-app-2.0.12\basic\vendor\yiisoft\yii2\db\Query.php at line 213 – yii\db\Command::queryAll()
8. in C:\xampp\htdocs\project\yii-basic-app-2.0.12\basic\vendor\yiisoft\yii2\db\ActiveQuery.php at line 135 – yii\db\Query::all(null)
9. in C:\xampp\htdocs\project\yii-basic-app-2.0.12\basic\controllers\UsersController.php at line 15 – yii\db\ActiveQuery::all()
9101112131415161718

use yii\web\Controller;
use app\models\Users;
class UsersController extends Controller
{
public function actionIndex()
{
$users = Users::find()->all();
print_r($users);
}
}

10. app\controllers\UsersController::actionIndex()
11. in C:\xampp\htdocs\project\yii-basic-app-2.0.12\basic\vendor\yiisoft\yii2\base\InlineAction.php at line 57 – call_user_func_array([app\controllers\UsersController, 'actionIndex'], [])
12. in C:\xampp\htdocs\project\yii-basic-app-2.0.12\basic\vendor\yiisoft\yii2\base\Controller.php at line 156 – yii\base\InlineAction::runWithParams(['r' => 'users/index'])
13. in C:\xampp\htdocs\project\yii-basic-app-2.0.12\basic\vendor\yiisoft\yii2\base\Module.php at line 523 – yii\base\Controller::runAction('index', ['r' => 'users/index'])
14. in C:\xampp\htdocs\project\yii-basic-app-2.0.12\basic\vendor\yiisoft\yii2\web\Application.php at line 102 – yii\base\Module::runAction('users/index', ['r' => 'users/index'])
15. in C:\xampp\htdocs\project\yii-basic-app-2.0.12\basic\vendor\yiisoft\yii2\base\Application.php at line 380 – yii\web\Application::handleRequest(yii\web\Request)
16. in C:\xampp\htdocs\project\yii-basic-app-2.0.12\basic\web\index.php at line 12 – yii\base\Application::run()
6789101112


require(__DIR__ . '/../vendor/autoload.php');
require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');

$config = require(__DIR__ . '/../config/web.php');

(new yii\web\Application($config))->run();
0

#2 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 3,372
  • Joined: 16-February 11
  • Location:Japan

Posted 24 October 2017 - 08:21 AM

/* Moved from "General Discussions" to "Installation and Setup" */

Check your db configuration.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users