Reputation: 17303
my php version is 5.4.6 and after downloading last snapshot of composer i can't create new project and upadate composer version.
php composer.phar create-project --stability=dev yiisoft/yii2-app-basic basic
Warning: This development build of composer is over 30 days old. It is recommended to update it by running "composer.phar self-update" to get the latest version.
[Composer\Downloader\TransportException]
The "https://packagist.org/packages.json" file could not be downloaded: Failed to enable crypto
failed to open stream: operation failed
create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repository-url="..."] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [--no-install] [package] [directory] [version]
php composer.phar self-update
[Composer\Downloader\TransportException]
The "https://getcomposer.org/version" file could not be downloaded: Failed to enable crypto
failed to open stream: operation failed
self-update
Upvotes: 1
Views: 1512
Reputation: 3332
Yii2 Installation
(1) First install Composer (LINUX):
Locally:
curl -sS https://getcomposer.org/installer | php
php -r "readfile('https://getcomposer.org/installer');" | php
curl -sS https://getcomposer.org/installer | php -- --install-dir=bin
OR
Globally:
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
(1) First install Composer (WINDOWS):
C:\Users\username>cd C:\bin
C:\bin>php -r "readfile('https://getcomposer.org/installer');" | php
Note: If the above fails due to readfile, use the http url or enable php_openssl.dll in php.ini
C:\bin>echo @php "%~dp0composer.phar" %>composer.bat*
C:\Users\username>composer -V Composer version 27d8904
(2) Yii2 framework online downloads:
Basic App: php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.0-beta
Advanced App: php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.0-beta
(3) Other App Settings Command:
php init
Note: set DB Cofig common/config/local-main.php
php yii migrate
Refference:
http://stuff.cebe.cc/yii2docs/guide-start-installation.html
https://github.com/yiisoft/yii2/tree/master/apps/advanced
Upvotes: 1