I want to install yii2 using Composer .

  1. Created a folder
  2. Made in the folder Composer init
  3. Then Composer install
  4. Then composer global require "fxp/composer-asset-plugin:^1.2.0"
  5. Now I want to download Yii to a folder so that the myProject hierarchy / yii files
  6. With cd I go out to the shared folder, with ls I see the folder myProject
  7. I do composer create-project --prefer-dist yiisoft / yii2-app-basic myProject

But here I get an error Project directory myProject/ is not empty .

How to solve the problem?

    1 answer 1

    And why in the folder do composer init and composer install ?

    If you want to install yii2 in the folder myProject, then

    1. Install composer

      • curl -sS https://getcomposer.org/installer | php
      • mv composer.phar /usr/local/bin/composer
    2. Then put the plug-in globally composer global require "fxp/composer-asset-plugin:^1.2.0"

    3. composer create-project --prefer-dist yiisoft/yii2-app-basic basic (instead of the basic path to your folder)

    4. run php requirements.php

    5. Change your database connection

    More clearly here

    If you have the composer and the fxp/composer-asset-plugin installed, then skip the first two points.