R
R
Rustam Akimov2018-02-19 14:14:54
Yii
Rustam Akimov, 2018-02-19 14:14:54

How to create a yii2 project correctly?

I'm trying to install yii, I use OpenServer as a server.
So I install composer:

cd modules/php/PHP-7.2-x64/
php -r "readfile('https://getcomposer.org/installer');" | php
echo @php "%~dp0composer.phar" %*>composer.bat

Next I install Yii
cd domains/localost
composer create-project --prefer-dist yiisoft/yii2-app-basic ./

When installing, an error pops up:
[InvalidArgumentException]
  Composer could not find the config file: C:\OpenServer\composer.phar
  To initialize a project, please create a composer.json file as described in
   the https://getcomposer.org/ "Getting Started" section

I can't figure out why it's looking for config in the root, mb because I already installed composer before

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2018-02-19
@webinar

I use OpenServer as a server.
So I put composer:

So OpenServer has composer, why install it?

A
Artem, 2018-02-19
@proudmore

composer should be locally next to the project, in the same directory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question