Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Install yii2 through composer on windows7

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Here we talk about the installation of the advance version and the basic version separately.

In Windows, you first need to download and run Composer-Setup.exe

1. Download composer.exe

Download URL: https://getcomposer.org/download/

two。 Enable openssl support for PHP

Modify the php.ini file under the PHP installation directory, for example: d:\ appSer\ php5, configuration file php.ini

Remove comments

3. Install Composer

Just click next all the time, and he will automatically recognize your php.exe. After installation, you will be prompted to reopen the CMD command line to use.

Type composer-v on the command line to determine whether the composer is installed successfully, and if the version number appears, the installation is successful.

The following is the installation of the advance version

(1) after Composer installation, change to a directory accessible through Web. Before installing yii2.0, yii2.0 's official website instructs us to install a plug-in composer-asset-plugin first.

Composer global require "fxp/composer-asset-plugin:~1.0.0"

Let's generate an app named "www.dh.com"

Composer create-project-prefer-dist-stability=dev yiisoft/yii2-app-advanced www.dh.com

You can see that an error was reported, indicating that there was a problem with the installation, and we installed a higher version of composer-asset-plugin.

Input

Composer global require "fxp/composer-asset-plugin:~1.2.0"

Input

Composer create-project-prefer-dist-stability=dev yiisoft/yii2-app-advanced www.dh.com

Find the www.dh.com folder under the website access directory and delete it.

Input

Composer create-project-prefer-dist-stability=dev yiisoft/yii2-app-advanced www.dh.com

Note that you need to enter the token of github, log in to the official website of github, and enter your personal settings. You can leave it empty for scops.

Then copy the resulting token over, and then display the prompt for the download completion in the following figure

4. Initialize the project

First go to the project directory of your installation and find the init script

Execute init script

Init

Select development environment

0

Whether or not to determine the choice

Yes

5. Test installation results

Address bar input: http://localhost/www.dh.com/frontend/web/index.php

You will see the following interface:

So far, the installation of Yii2-advance is complete!

The file directory for the advance version looks like this:

Here is the installation of the basic version:

After installing composer, change the directory to the access directory of web, and execute:

Composer global require "fxp/composer-asset-plugin:~1.1.1" composer create-project-prefer-dist yiisoft/yii2-app-basic basic2

Because I have already installed the advance version on my computer before, the things I need to use in the circled place do not need to be re-downloaded, just read it.

Then verify it in the browser:

The file directory for basic is as follows:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report