yii2.0安装失败 [ 2.0 版本 ]
按照这个教程来的输入链接说明,我旁边的一个同事也是照着这个来的,一次就成功了,偏偏我的不行,第一步下载就出错了,下面是错误代码
E:\WWW\upupwapache\vhosts\test.test.com>php -r "readfile('https://getcomposer.or
g/installer');" | php
version to install instead of the latest
--filename="..." accepts a target filename (default: composer.phar)
--disable-tls disable SSL/TLS security for file downloads
--cafile="..." accepts a path to a Certificate Authority (CA) certificate
file for SSL/TLS verification
EOF;
}
/**
* check the platform for possible issues on running composer
*/
function checkPlatform($quiet, $disableTls)
{
$errors = array();
$warnings = array();
$iniPath = php_ini_loaded_file();
$displayIniMessage = false;
if ($iniPath) {
$iniMessage = PHP_EOL.PHP_EOL.'The php.ini used by your command-line PHP
is: ' . $iniPath;
} else {
$iniMessage = PHP_EOL.PHP_EOL.'A php.ini file does not exist. You will h
ave to create one.';
}
$iniMessage .= PHP_EOL.'If you can not modify the ini file, you can also run
`php -d option=value` to modify ini values on the fly. You can use -d multiple
times.';
if (ini_get('detect_unicode')) {
$errors['unicode'] = 'On';
}
if (extension_loaded('suhosin')) {
$suhosin = ini_get('suhosin.executor.include.whitelist');
$suhosinBlacklist = ini_get('suhosin.executor.include.blacklist');
if (false === stripos($suhosin, 'phar') && (!$suhosinBlacklist || false
!== stripos($suhosinBlacklist, 'phar'))) {
$errors['suhosin'] = $suhosin;
}
}
if (!function_exists('json_decode')) {
$errors['json'] = true;
}
if (!extension_loaded('Phar')) {
$errors['phar'] = true;
}
if (!extension_loaded('filter')) {
$errors['filter'] = true;
}
if (!extension_loaded('hash')) {
$errors['hash'] = true;
}
if (!ini_get('allow_url_fopen')) {
$errors['allow_url_fopen'] = true;
}
if (extension_loaded('ionCube Loader') && ioncube_loader_iversion() < 40009)
{
$errors['ioncube'] = ioncube_loader_version();
}
if (version_compare(PHP_VERSION, '5.3.2', '<')) {
$errors['php'] = PHP_VERSION;
}
if (version_compare(PHP_VERSION, '5.3.4', '<')) {
$warnings['php'] = PHP_VERSION;
}
if (!extension_loaded('openssl') && true === $disableTls) {
$warnings['openssl'] = true;
} elseif (!extension_loaded('openssl')) {
$errors['openssl'] = true;
}
if (!defined('HHVM_VERSION') && !extension_loaded('apcu') && ini_get('apc.en
able_cli')) {
$warnings['apc_cli'] = true;
}
ob_start();
phpinfo(INFO_GENERAL);
$phpinfo = ob_get_clean();
if (preg_match('{Configure Command(?: *</td><td class="v">| *=> *)(.*?)(?:</
td>|$)}m', $phpinfo, $match)) {
$configure = $match[1];
if (false !== strpos($configure, '--enable-sigchild')) {
$warnings['sigchild'] = true;
}
if (false !== strpos($configure, '--with-curlwrappers')) {
$warnings['curlwrappers'] = true;
}
}
if (!empty($errors)) {
out("Some settings on your machine make Composer unable to work properly
.", 'error');
out('Make sure that you fix the issues listed below and run this script
again:', 'error');
foreach ($errors as $error => $current) {
switch ($error) {
case 'json':
$text = PHP_EOL."The json extension is missing.".PHP_EOL;
$text .= "Install it or recompile php without --disable-json
";
break;
case 'phar':
$text = PHP_EOL."The phar extension is missing.".PHP_EOL;
$text .= "Install it or recompile php without --disable-phar
";
break;
case 'filter':
$text = PHP_EOL."The filter extension is missing.".PHP_EOL;
$text .= "Install it or recompile php without --disable-filt
er";
break;
case 'hash':
$text = PHP_EOL."The hash extension is missing.".PHP_EOL;
$text .= "Install it or recompile php without --disable-hash
";
E:\WWW\upupwapache\vhosts\test.test.com>
好像是直接打开了,但是并没有下载,然后我又去下载了一个composer.phar放在了目录下,然后去执行第二步准备所有插件,还是不行
E:\WWW\upupwapache\vhosts\test.test.com>php composer.phar global require "fxp/co
mposer-asset-plugin:1.0.0"
Changed current directory to C:/Users/Administrator/AppData/Roaming/Composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
[RuntimeException]
Could not load package fxp/composer-asset-plugin in http://packagist.org: [
UnexpectedValueException] Could not parse version constraint ^1.0: Invalid
version string "^1.0"
[UnexpectedValueException]
Could not parse version constraint ^1.0: Invalid version string "^1.0"
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update]
[packages1] ... [packagesN]
E:\WWW\upupwapache\vhosts\test.test.com>
我现在再用我那个同事安装好的文件,但是我想知道我的为什么装不了,都是一步一步来的,我们俩用的环境都是一样的,而且他并没有配环境变量
共 2 个回答
-
-
直接使用 composer create-project yiisoft/yii2-app-basic yourprojectname // windows
原文出处 http://www.yiiframework.com/download/
醉丶春风 上海
注册时间:2015-11-23
最后登录:2024-09-25
在线时长:819小时28分
最后登录:2024-09-25
在线时长:819小时28分
- 粉丝8
- 金钱11885
- 威望100
- 积分21075