Home > PHP Framework > YII > body text

How to install yii2.0

爱喝马黛茶的安东尼
Release: 2019-12-09 14:42:36
Original
2077 people have browsed it

How to install yii2.0

1. Installation environment

Because the Yii framework requires PHP5.5 or above, so first put your Uninstall PHP5.3. If you think there are too many connections and don’t want to bother you, just delete PHP, MySQL, and Apache, and then use phpStudy2016 to handle them all.

2. Install Composer

Double-click Composer.exe, then click Next,

How to install yii2.0

Click Browser to select manually The installation path of php.exe (some versions will automatically find the installation path of php.exe), because the integrated environment PHPStudy is used here, and the version is switched to version 5.5, so select the picture above, and then click Next,

How to install yii2.0

Check the only option, then click Next,

How to install yii2.0

This step is to set the prefix, don’t worry, just click Next,

How to install yii2.0

Click Install to start the installation,

Click Next, click Next, click Next, click Finish, you are done!

3. Install the Yii framework

The Yii framework is different from the previous framework and needs to be installed. Download the Yii framework (or use the installation package downloaded by others, there are two versions basic and advanced, this example uses basic), unzip and put the file package into the project root directory of the server (in this example, D:\PhpStudy\WWW ).

Method 1 (available for both basic and advanced versions)

Open the web.config file in the config folder and find the cookieValidationKey

How to install yii2.0

Add a random password, such as 123456, and save it. Enter the browser and click step by step to enter the following address in list mode:

http://www.xueqiyao.com/Yii/advanced/frontend/web/

The following interface appears, indicating that the installation is successful. .

How to install yii2.0

Method 2 (only for advanced version)

Open cmd, enter d: enter D disk, and then enter the advanced folder, D:\> cd PhpStudy\WWW\advanced, enter init after entering to indicate initialization, press Enter, it may prompt The OpenSSL PHP extensioin is required by Yii, then open php.ini Find extension=php_openssl.dll in the file, remove the previous comment, return to execute the init command again, pop up the option, enter 0 (indicates selecting the development environment), pop up the option, enter yes and press Enter, and finally completed appears to indicate that the installation is complete. ); change ‘db’ in common/config/main-local.php, connect to the database, and then execute the php yii migrate command in the cmd command line to automatically generate the user table in the connected database.

PHP Chinese website has a large number of free Yii introductory tutorials, everyone is welcome to learn!

The above is the detailed content of How to install yii2.0. 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