3

I am trying to install Yii2 on WAMP using composer.

c:\Users\username>php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.0

I am getting the following error when I run the command which is given above.

[ErrorException] Argument 1 passed to Fxp\Composer\AssetPlugin\Repository\BowerRepository::createVcsRepositoryConfig() must be of the type array, null given, called in C:\Users\username\AppData\Roaming\Composer\vendor\fxp\composer-asset-plugin\Repository\AbstractAssetsRepository.php on line 136 and defined

Can someone help solving this error? But, it is created a folder named "basic".

I have copied this folder to D:\wamp\www and when I access localhost/basic/web/ from browser, I am getting the following error.

ReflectionException
Class yii\debug\Module does not exist

I am following the instructions to install yii2 from http://www.yiiframework.com/download/

Please assist me to resolve these issues.

Thanks

5
  • Have you tried to run app creation without specifying the version? php composer.phar create-project yiisoft/yii2-app-basic basic Commented Nov 17, 2014 at 11:20
  • have you tried updating composer via composer self-update? and have you added the composer plugin specified in the Yii installation instructions? Commented Nov 17, 2014 at 22:57
  • Yes, I have tried it without specifying the version and used composer self-update also. I still see the same error. I have already run the command php composer.phar global require "fxp/composer-asset-plugin:1.0.0-beta3" before creating basic app of yii2 Commented Nov 18, 2014 at 4:23
  • Hi, I tried installing it by downloading basic template archive file from the url yiiframework as an alternative method of installing yii2. It is working now. But, I am wondering how to resolve the error if I use composer to install yii2. Commented Nov 18, 2014 at 6:06
  • what is your wamp version?beacuse if you don't use the version 2.5 the composser not work Commented Jun 25, 2015 at 9:09

2 Answers 2

1

First windows does not have a curl processor like unix so you need to use the other option for installing Composer

php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"

For this to work you need the php.exe processor to be on your path, so you have 2 options here. Either add the c:\wamp\bin\php\phpx.y.z folder to your PATH or my prefered option write yourself a little .cmd file which will do it for you like this

addphp.cmd
PATH=%PATH%;c:\wamp\bin\php\phpx.y.z

Put this file in a folder already registered on your path so you can run it from anywhere in a command window.

Now you will have to edit the \wamp\bin\php\phpx.y.z\php.ini file. This is similiar to the one used by php code run through the Apache web server but is only used by the PHP CLI (Command Line Interpreter)

Make sure the extension php_curl is uncommented or the above line wont work i.e. remove the ; comment symbol

extension=php_curl.dll

So now run a command window, cd into the folder that you want composer installed into and run the command above, then follow the rest of the install instructions on Install instructions

Sign up to request clarification or add additional context in comments.

Comments

0

EDIT: Thank you for reminding me.

This error happens because of invalid json on plugin you or application requested (npm or bower).

The link here suggests you to run:

composer global update.

This will update composer cache. Hope it helps.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.