In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to install yii2 in composer. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
How does composer install yii2?
1. Install composer
Mine is win7 (used for 8 years), download address: https://getcomposer.org/download/, very simple English, don't say you can't understand, you can not be good at English, but
You must remember these words: download, windows, linux, install, setup.
All right, download it and install it. During this period, your php version directory will be automatically selected. You should make sure that the php version is greater than 5.4.
Then you pay attention to the directory in which composer is installed. Mine is installed on disk C composer, where it is automatically added to the system variable, so you don't have to add it manually.
Correlation
2.cmd operation
① opens cmd and outputs the composer-V command to see if the installation is successful.
② changes to the previous composer installation directory, or it may not be necessary, because it was previously added to the system variable, but just in case, cut to the composer directory
③ changes the address of the downloaded image to the domestic image, otherwise it will be very miserable when downloading!
Enter with the following command: composer config-g repo.packagist composer https://packagist.phpcomposer.com
④ download Yii2
At this point, you can change the cmd directory to the folder under the root directory on the local server, for example: d:\ phpstudy\ WWW\ php\ demo
Then: composer global require "fxp/composer-asset-plugin:~1.1.1" enter
Then: composer create-project-- prefer-dist yiisoft/yii2-app-basic basic enter (I install the basic version here)
At the third red line, you are required to enter Token (github), so you have to go to github to get a Token:
The steps are as follows:
Log in to your github--- > upper right corner of your avatar-- > Settings--- > the last Developer settings--- in the left sidebar > Personal access tokens in the left sidebar
-> Generate new token, then a page will pop up, fill in your github password, then fill in the description of the token, check all below, submit, and generate token.
After the cmd has filled in the token, it will start to download, probably 10min, and the download is complete.
At this time, open the demo folder and you will see an additional basic folder below. Open it and you will see:
In this way, the Yii2 framework will be downloaded to your project, and the entry file is web/index.php,then. Open the browser and enter the path of the entry file under the project:
Http://localhost/php/demo/basic/web/index.php, and then you can see the page you saw at the beginning of the article!
This is the end of this article on "how to install yii2 in composer". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.