Yii 2 installation error - yii2

I am installing new yii2 project.I have already installed the controller .but when i run following command in terminal
php composer.phar create-project --stability=dev yiisoft/yii2-app-basic my_yii2_trial
and for
php composer.phar create-project yiisoft/yii2-app-basic basic
for both this command Its showing error that,
[InvalidArgumentException]
Could not find package yiisoft/yii2-app-basic with stability stable.
Please help.

Why don't you follow official documentation?
http://www.yiiframework.com/doc-2.0/guide-start-installation.html
composer global require "fxp/composer-asset-plugin:~1.1.1"
composer create-project --prefer-dist yiisoft/yii2-app-basic basic

Related

Can not use composer for installing amnah user for yii2

i want to use amnah-yii2 user but i could not use the composer to install it. when i run composer this error occure.
Could not open input file: composer.phar
Regards

Can't install Yii2 via Composer

I'm trying to install Yii2 via Composer (OS X El Capitan 10.11.3).
I did this
php composer.phar global require "fxp/composer-asset-plugin:~1.1.1"
and then
php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.9
and I've got errors like
yiisoft/yii2 2.0.9 requires bower-asset/jquery 2.2.#stable | 2.1.#stable | 1.11.#stable | 1.12.#stable -> no matching package found.
I don't know why it happens. I tried to reinstall (composer and asset-plugin), diff version as well and again the same problem with yiisoft/yii2 2.0.9 requires bower-asset/jquery 2.2.#stable
Try to install composer global require "fxp/composer-asset-plugin: *" first. Also, make sure you have these added in your composer.json file:
"extra": {
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
Another solution is to attempt to self-update:
composer self-update --rollback
If these solutions did not work, you can try to use this sequence of commands:
rm -rf ~/.composer/vendor
rm ~/.composer/composer.lock
cd ~/.composer
composer clear-cache
composer self-update
composer global require "fxp/composer-asset-plugin:~1.1.3"
composer install
Source 1 | Source 2 | Source 3 | Source 4
composer global require "fxp/composer-asset-plugin:~1.1.1"
composer create-project --prefer-dist yiisoft/yii2-app-advanced yii-application
The first command installs the composer asset plugin which allows managing bower and npm package dependencies through Composer. You only need to run this command once for all.
The second command installs the latest stable version of Yii in a directory named basic. You can choose a different directory name if you want.

Advanced Template installation issue [ErrorException] touch(): Utime failed: Permission denied

I am using YII2 for my project,I have created a project(advanced template) using composer, now I need to start another project, firstly I have update composer(composer self-update), it is fine. now I am trying to complete installation process of YII2 advanced template on my lampp using composer, on the step Configuring Composer getting following error,
[ErrorException]
touch(): Utime failed: Permission denied
Can someone help me, why the problem is occur in 2nd time installation?
Thanks
You can run composer as root user or use the following command
sudo composer create-project --prefer-dist yiisoft/yii2-app-advanced [project-name]
If you are using windows machine
1.Add permission via right click on folder like /myprojects > properties > security
2.composer create-project --prefer-dist yiisoft/yii2-app-advanced [project-name]
Or if you on Linux machine please add permissions
1.sudo php composer clear-cache
2.sudo composer create-project --prefer-dist yiisoft/yii2-app-advanced [project-name]

Yii2 DatePicker installation

Found documentation about this widget here and library here.
Tried to install with Composer and failed:
Tried to copy "yiisoft/yii2-jui": "~2.0.0" to composer.json and then update Composer and failed again:
Class 'yii\jui\DatePicker' not found
Is there any way to install this extension without using Composer?
Did you install composer global require "fxp/composer-asset-plugin:1.0.0" ? It is a NPM/Bower Dependency Manager for Composer that required by yii2. Before installing yii2-jui try this command, and then composer update

Installing behat with mink on windows using composer

I am trying to install mink/behat on windows machine using composer by following the help given on behat page. http://docs.behat.org/cookbook/behat_and_mink.html.
But when I run
php composer.phar install
then I get the error
But I have composer.json(exactly same as described in behat page) file in mentioned directory. Can someone please guide me how can I install it. Thanks
Composer installs packages on project-base. I don't think you have a PHP project inside C:\Windows\system32...
Navigate to your project by using cd (change dir) and be sure the composer.phar file is automatically loaded in every directory (see this answer).
Then create a composer.json file in which you put the things that is stated in the docs.
After that run composer install (or php composer.phar install, depends on which install method you used).