yii基础和高级版安装

yii2.0基础版安装

第一步从官网上下载好yii2.0的基础版本

第二步就把下载好的yii2.0基础版解压到你服务器下的www文件夹下面

访问下面的链接就应该成功了:

yii2.0高级版安装

初始化之后,配置数据库信息。打开模板文件找到common\config里面有main-local.php,输入用户名,密码,数据库名(已存在,不存在要自己创建)。这里也要注意一个地方这里数据库中必须要有user表格不然也会出现错误的哦。

		<?php
		return [
		'components' => [
		'db' => [
		'class' => 'yii\db\Connection',
		'dsn' => 'mysql:host=localhost;dbname=lnctime',
		'username' => 'root',
		'password' => '',
		'charset' => 'utf8',
		],
		'mailer' => [
		'class' => 'yii\swiftmailer\Mailer',
		'viewPath' => '@common/mail',
		'useFileTransport' => true,
		],
		],
		];

访问http://localhost/hezi/backend/web/index.php就可以访问后台,http://localhost/hezi/frontend/web/index.php就可以访问前台了。

kkdemian
hyperliquid