Home > PHP Framework > YII > body text

How to install the yii framework in win environment?

青灯夜游
Release: 2020-07-24 10:46:46
Original
2929 people have browsed it

How to install the yii framework in win environment?

First method: Installation in the form of archive file (suitable for machines without composer installed)

Enter the download page https://www.yiiframework.com/download, choose to download the first

After the download is completed, there will be a compressed package, unzip it folder, just put it in the specified project directory file

Then try to access the directory and find an error.

Solution: Find web.php in the config directory File, probably line 17, just set the parameter value for cookieValidationKey (cookie encryption key); there is no need to modify it manually when using composer.

 'basic',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'aliases' => [
        '@bower' => '@vendor/bower-asset',
        '@npm'   => '@vendor/npm-asset',
    ],
    'components' => [
        'request' => [
            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
            'cookieValidationKey' => 'abcdefg',  //给参数值即可
        ],
Copy after login

Second: Install with composer (needs to circumvent the wall)

First of all, you need to install composer under windows, not much here said. Of course, you also need to configure PHP environment variables, which I won’t go into here.

Address: https://getcomposer.org/Composer-Setup.exe

After Composer is installed, switch to a directory accessible through the Web and execute the following command You can install Yii:

Enter the dos command window through the windows'cmd' command and execute the following command

composer global require "fxp/composer-asset-plugin:~1.0.0"
Copy after login

How to install the yii framework in win environment?

composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced www.dh.com
Copy after login

This The execution of this step takes a long time, and you may also be asked to enter your git username and password

How to install the yii framework in win environment?

How to install the yii framework in win environment?

. At this point, the installation is basically completed. The following steps It is initialization

First enter the project directory of your installation and find theinitscript

How to install the yii framework in win environment?

Execute the init script

init
Copy after login

Select development environment

0
Copy after login

Are you sure to choose

yes
Copy after login

How to install the yii framework in win environment?

成成

#Version upgrade

If you upgrade, there are official instructions. In fact, it is to enter the project directory in dos and execute a command

composer update yiisoft/yii2 yiisoft/yii2-composer bower-asset/inputmask
Copy after login

##Related article tutorials Recommended: "

yii Framework Tutorial

", "PHP Tutorial"

The above is the detailed content of How to install the yii framework in win environment?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!