Yii2 - install framework with composer

voted: 1
yii2 framework composer

Steps for installing Yii2 framework with composer:

1. Run console and navigate to web root folder (htdocs for example - depends on configuration)
2. run composer with crete-project command:
- for basic template
php composer.phar create-project yiisoft/yii2-app-basic project_name
- for advanced template
php composer.phar create-project yiisoft/yii2-app-advanced project_name
(sometimes just 'composer' instead of 'php composer.phar', if somebody knows why please give comment).
That is enough for run framework template.
Check url: localhost/project_name/web. If all was installed properly congratulation information is displayed on site.
3. For use database go to phpmyadmin and create new database.
Then modify \umodule\config\db.php to math new database parameters:


return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=localhost;dbname=database_name',
    'username' => 'dbuser_name',
    'password' => 'password',
    'charset' => 'utf8',
working url: not entered
version: 2
Leave a Comment:
Characters left:
No comments yet.