Mac Install composer install Yii2 project

Source: Internet
Author: User
Tags diff composer install yii

"Note:" I original, if you want to reprint please indicate the source link! Installing Yii by installing the composer method

If you have not yet installed Composer, you can install it by getcomposer.org. In Linux and Mac OS X, you can run the following command:

Curl-ss Https://getcomposer.org/installer | PHPMV Composer.phar/usr/local/bin/composer

Steps:

First, open the terminal

Second, installation composer:

1, terminal input: Curl-ss Https://getcomposer.org/installer | PHPComposer installed successfully 2, terminal input: MV composer.phar/usr/local/bin/composer move Composer.phar to/usr/local/bin/  Composer supports global access composer Command 3, authentication method: (Note: You need access, otherwise you will be prompted to do not have permission to access) input: composer-v   

Third, installation Yii2

Composer after installation, switch to a WEB-accessible directory and execute the following command to install Yii:composer global require "fxp/composer-asset-plugin:^1.2.0" Composer Create-project--prefer-dist yiisoft/yii2-app-basic basic1, terminal input: Composer global require "fxp/composer-asset-plugin:^ 1.2.0 "If you have not installed the GII the process will prompt you whether to install, install (the following personal project name Cqy, of course, can also be modified to the project name you want) 2, terminal input: Composer Create-project--prefer-dist Yiisoft/yii2-app-basic Cqy If the following prompt appears:

Indicates that you have insufficient authority, enter sudo-s, provide root permission

Re-enter the command after you have permission, and when it's halfway through, you'll find that token is needed.

You need a GitHub account to get the token command.
3. Get token
When you use GitHub to get data, you need to register for a GitHub account
After the account-->setting click on the page refresh, click Personal Access tokens, click the Generate new Token button to generate tokens
After obtaining the token, enter it to continue the installation as follows:
Token (hidden): Token stored successfully. Package operations:59 installs, 0 updates, 0 removals-installing yiisoft/yii2-composer (2.0.5): Downloading (100% )-Installing Swiftmailer/swiftmailer (v5.4.7): Downloading (100%)-Installing Bower-asset/jquery (2  .2.4): Downloading (100%)-Installing Bower-asset/yii2-pjax (v2.0.6): Downloading (100%)-Installing           Bower-asset/punycode (v1.3.2): Downloading (100%)-Installing Cebe/markdown (1.1.1): Downloading (100%) -Installing Ezyang/htmlpurifier (v4.9.2): Downloading (100%)-Installing Bower-asset/jquery.inputmask (3.3  .5):D ownloading (100%)) -Installing YIISOFT/YII2 (2.0.11.2): Downloading (100%)-Installing Yiisoft/yii2-swiftmailer (2.0.6): Download ING (100%)-Installing Bower-asset/bootstrap (v3.3.7): Downloading (100%)-Installing Yiisoft/yii2-b Ootstrap (2.0.6): Downloading (100%)-Installing Yiisoft/yiI2-debug (2.0.9): Downloading (100%)-Installing Bower-asset/typeahead.js (v0.11.1): Downloading (100%)  -Installing Phpspec/php-diff (v1.1.0): Downloading (100%)-Installing Yiisoft/yii2-gii (2.0.5): Downloading (100%)-Installing Fzaninotto/faker (v1.6.0): Downloading (100%)-Installing Yiisoft/yii2-faker (2. 0.3): Downloading (100%)-Installing Psr/log (1.0.2): Downloading (100%)-Installing Symfony/debug ( v3.2.7): Downloading (100%)-Installing symfony/polyfill-mbstring (v1.3.0): Downloading (100%)-Inst Alling Symfony/console (v3.2.7): Downloading (100%)-Installing Stecman/symfony-console-completion (0.7.0): Dow Nloading (100%)-Installing Sebastian/diff (1.4.1): Downloading (100%)-Installing Sebastian/recursion-con Text (2.0.0): Downloading (100%)-Installing Sebastian/exporter (2.0.0): Downloading (100%)-Install ing Sebastian/comparator (1.2.4): Downloading (100%)-Installing Behat/gherkin (v4.4.5): Downloading (100%)-Installing SYMF           Ony/dom-crawler (v3.2.7): Downloading (100%)-Installing Symfony/css-selector (v3.2.7): Downloading (100%) -Installing Symfony/browser-kit (v3.2.7): Downloading (100%)-Installing Symfony/yaml (v3.2.7): Download ING (100%)-Installing Symfony/event-dispatcher (v3.2.7): Downloading (100%)-Installing Symfony/fin Der (v3.2.7): Downloading (100%)-Installing Psr/http-message (1.0.1): Downloading (100%)-Installin           G Guzzlehttp/psr7 (1.4.2): Downloading (100%)-Installing Sebastian/version (2.0.1): Downloading (100%) -Installing Sebastian/environment (2.0.0): Downloading (100%)-Installing Sebastian/code-unit-reverse-looku P (1.0.1): Downloading (100%)-Installing Phpunit/php-token-stream (1.4.11): Downloading (100%)-Installin G Phpunit/php-text-templAte (1.2.1): Downloading (100%)-Installing Phpunit/php-file-iterator (1.4.2): Downloading (100%)-I Nstalling phpunit/php-code-coverage (4.0.8): Downloading (100%)-Installing sebastian/resource-operations (1.0. 0): Downloading (100%)-Installing Sebastian/object-enumerator (2.0.1): Downloading (100%)-Installin G Sebastian/global-state (1.1.1): Downloading (100%)-Installing Doctrine/instantiator (1.0.5): Downloading (10  0%)-Installing phpunit/phpunit-mock-objects (3.4.3):D ownloading (100%)) -Installing Phpunit/php-timer (1.0.9): Downloading (100%)-Installing Webmozart/assert (1.2.0): Downloading (1 00%)-Installing Phpdocumentor/reflection-common (1.0): Downloading (100%)-Installing phpdocumentor/ Type-resolver (0.2.1): Downloading (100%)-Installing Phpdocumentor/reflection-docblock (3.1.1): Downloading (1 00%)-Installing Phpspec/prophecy (v1.7.0): DoWnloading (100%)-Installing Myclabs/deep-copy (1.6.1): Downloading (100%)-Installing Phpunit/phpun It (5.7.19): Downloading (100%)-Installing Codeception/base (2.2.10): Downloading (100%)-Installin         G Codeception/verify (0.3.3): Downloading (100%)-Installing Codeception/specify (0.4.6): Downloading (100%) Symfony/console suggests installing Symfony/filesystem () Symfony/console suggests installing symfony/process () SYMFO Ny/browser-kit suggests installing symfony/process () Symfony/event-dispatcher suggests installing symfony/ Dependency-injection () Symfony/event-dispatcher suggests installing Symfony/http-kernel () phpunit/php-code-coverage suggests installing Ext-xdebug (^2.5.1) sebastian/global-state suggests installing Ext-uopz (*) Phpunit/phpunit suggests Installing Phpunit/php-invoker (~1.1) Phpunit/phpunit suggests installing ext-xdebug (*) Codeception/base suggests Installing Flow/jsonpath (for using Jsonpath in REST modulE) Codeception/base suggests installing phpseclib/phpseclib (for SFTP option in FTP Module) Codeception/base suggests Insta Lling League/factory-muffin (for DataFactory module) Codeception/base suggests installing League/factory-muffin-faker ( For Faker, DataFactory module) Codeception/base suggests installing Symfony/phpunit-bridge (for Phpunit-bridge s Upport) Writing lock filegenerating autoload files> yii\composer\installer::p ostcreateprojectchmod (' Runtime ', 0777 ) ... done.chmod (' web/assets ', 0777) ... done.chmod (' Yii ', 0755) ... done.
Installation is successful!

Mac Install composer install Yii2 project

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.