How to install yii2, yii2 practical tutorial _ PHP Tutorial

Source: Internet
Author: User
How to install yii2 and yii2. Yii2 practical tutorial how to install yii2, Yii2 practical tutorial official documentation provides two yii2 installation methods. One is to install through an archive file, and the other is to install through composer. How to install the two yii2 practical tutorials, yii2 practical tutorials

The official documentation provides two Yii2 installation methods. One is to install through an archive file, and the other is to install through composer. What are the differences between the two methods? We will not discuss it here. after installation, you will naturally understand it.

I believe many of my friends want to learn Yii2, but most of them are dead at the beginning. Yii2 is undoubtedly better able to prove this point because it is difficult to start with everything.

Preparations before installation

Install through archive files
We first install Yii2 in a simple way. The so-called simple method is actually better to say that it is easier to install successfully, that is, to install Yii2 through an archive file! That is to say, the basic framework is organized by others. you only need to download and decompress the framework and perform simple configuration. Why is it necessary to install the archive file? in fact, you and I understand it in your mind, because another installation method fails and you have no choice. Let's take a look at the specific operation steps

1. go to the official website to download an advanced template. we will not introduce the basic template, but we will not introduce it. Please refer to the location marked in for download

(See the original image)

2. decompress the package and copy the "advanced" directory to the accessible web directory. the file name is "advanced" without modification.

3. if you are a linux-like system, switch to the advanced directory and execute the php init command for initialization. if you are a windows system, double-click the init. bat file under the advanced directory.

4. Next, let's select the development environment 0 development environment 1 production environment Here we select the development environment 0, enter the input and press Enter. we will enter yes or no for confirmation, enter yes here to confirm.

5. verify whether the installation is successful. you can enter http: // localhost/advanced/frontend/web/in the address bar of your browser/

After reading the results, a large Congratulations is displayed on the interface, indicating that the installation is successful!

Install using Composer
If you have heard of composer for the first time or used composer for the first time, I suggest you first understand what composer is. what does this guy do. Here is a Composer Chinese document, which is helpful to you!

Generally, the data of the composer installation package (mainly zip files) is downloaded from github.com, and the metadata of the installation package is downloaded from packagist.org. As we all know, the connection speed of foreign websites is very slow and may be "wall" or even "not exist" at any time, which will lead to the failure of many composer. We recommend that you refer to Packagist/composer's full-volume image for your domestic Composer Image. as a result, we will no longer be afraid of failure when installing or updating the image through composer. of course, you still can't do it when the network speed is slow. Let's take a look at the specific operation steps

[Considering that most of the articles collected on Chinese websites are very frequent at present, the author does not specify the source of the original article. the original author prefers the readers to check the original article to avoid updating all the articles due to any problems and avoid misleading.]

Continue reading

How to install http://www.bkjia.com/PHPjc/1129136.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1129136.htmlTechArticleyii2 practice tutorial, yii2 practice tutorial official documentation provides two Yii2 installation method. One is to install through an archive file, and the other is to install through composer. Two...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.