2013-12-12 105 views
1

我的PHP版本是5.4.6,下載作曲家的最後快照後,我無法創建新項目並上傳作曲家版本。Yii2與作曲家創建新項目

PHP composer.phar創建項目--stability =開發yiisoft/yii2-APP-基本基本

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自我更新

[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 

回答

1

Yii2安裝


(1)第一安裝作曲(LINUX):

本地:

捲曲-sS https://getcomposer.org/installer | php

php -r「readfile('https://getcomposer.org/installer');」 | php

curl -sS https://getcomposer.org/installer | PHP - --install-DIR =斌

OR

全球:

捲曲-sS https://getcomposer.org/installer | PHP

MV composer.phar的/ usr/local/bin中/作曲家

(1)第一安裝作曲(WINDOWS):

C:\ Users \用戶名> cd C:\ bin

C:\ bin> php -r「readfile('https://getcomposer.org/installer');」 | PHP

注:如果上述失敗,因爲READFILE,使用HTTP URL或啓用php_openssl.dll在php.ini

C:\倉>回波@php「%〜dp0composer.phar 「%>作曲家。蝙蝠*

C:\ Users \用戶名>作曲家-V 作曲版本27d8904


(2)Yii2框架在線下載:

基本應用: php composer.phar create-project yiisoft/yii2 -app-基本基本2.0.0-β

高級應用: PHP composer.phar創建項目yiisoft/yii2,應用先進的先進2.0.0-β


(3)其他應用程序設置命令:

p HP初始化

注:組DB Cofig通用/配置/本地main.php

PHP警予遷移


REFFERENCE:

http://stuff.cebe.cc/yii2docs/guide-start-installation.html

https://github.com/yiisoft/yii2/tree/master/apps/advanced