Yii is a popular, powerful and highly extensible framework for faster application development. I found many newbies to struggling for successfully install, run and develop Yii application. Those who are learning it may find useful to install Yii 2.0 manually or without composer as demonstrated in this article.
Note: I would suggest you to install Yii through composer as suggested in official docs because it allows you to install new extensions and update simply using single command.
Install Yii 2.0 Manually or without Composer
To start to Yii project you first need to download archive file which contains Yii core and ready to use basic template. Extract it and upload in web accessible folder (a folder inside htdocs in XAMPP at local).
So I have placed all Yii files and folder inside ‘basic-yii‘ directory which is a web accessible folder in my local development environment. Next is open ‘web.php’ file inside ‘config‘ folder and place a ‘cookieValidationKey‘ value which you can obtain randomly from this link and save file.
$config = [ 'id' => 'basic', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log'], 'components' => [ 'request' => [ // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation 'cookieValidationKey' => 'ENTER-YOUR-SECRET-KEY-HERE', ], 'cache' => [ 'class' => 'yii\caching\FileCache', ], 'user' => [ 'identityClass' => 'app\models\User', 'enableAutoLogin' => true, ],
It’s time to check the installation. Open the browser and access the URL:
http://localhost/basic-yii/web/index.php
A working application powered by Twitter Bootstrap and Yii along with home, about, contact and a login page will be there for you. It’s all the way to Install Yii 2.0 Manually or without Composer.
Hi you can download yii 2 also from here. Its the same like with composer but you dont need a local installation: https://php-download.com/package/yiisoft/yii2-app-basic