使用composer安装CakePHP 3.0时出错

时间:2014-08-08 16:04:11

标签: php git cakephp composer-php

我尝试安装cakephp 3.0运行:

composer create-project -s dev cakephp/app cakedev

还有git cloning cakephp/app然后运行composer update但是我一直遇到同样的错误:

Installing cakephp/cakephp (3.0.x-dev 0a2ff83)
    Cloning 0a2ff83156e5725b7e9339fb655e280ee70ce5aa
Executing command (CWD): git clone --no-checkout 'git://github.com/cakephp/cakephp.git' '/home/vagrant/www/cakedev/vendor/cakephp/cakephp' && cd '/home/vagrant/www/cakedev/vendor/cakephp/cakephp' && git remote add composer 'git://github.com/cakephp/cakephp.git' && git fetch composer
Failed: [Symfony\Component\Process\Exception\ProcessTimedOutException] The process "git clone --no-checkout 'git://github.com/cakephp/cakephp.git' '/home/vagrant/www/cakedev/vendor/cakephp/cakephp' && cd '/home/vagrant/www/cakedev/vendor/cakephp/cakephp' && git remote add composer 'git://github.com/cakephp/cakephp.git' && git fetch composer" exceeded the timeout of 300 seconds.
Failed to download cakephp/cakephp from source: The process "git clone --no-checkout 'git://github.com/cakephp/cakephp.git' '/home/vagrant/www/cakedev/vendor/cakephp/cakephp' && cd '/home/vagrant/www/cakedev/vendor/cakephp/cakephp' && git remote add composer 'git://github.com/cakephp/cakephp.git' && git fetch composer" exceeded the timeout of 300 seconds.
Now trying to download from dist
  - Installing cakephp/cakephp (3.0.x-dev 0a2ff83)

Failed: [RuntimeException] Could not delete /home/vagrant/www/cakedev/vendor/cakephp/cakephp/.git/objects/pack/tmp_pack_9VVOjS:

Reading ./composer.json
Loading config file ./composer.json



  [RuntimeException]

  Could not delete /home/vagrant/www/cakedev/vendor/cakephp/cakephp/.git/objects/pack/tmp_pack_9VVOjS:

enter image description here

我尝试使用sudo运行命令,但也会出错。

有什么想法吗?

2 个答案:

答案 0 :(得分:6)

删除〜/ .composer / cache / *中的composer缓存并尝试使用此方法增加composer超时

尝试使用--prefer-dist选项如果不起作用,请尝试增加composer超时(默认为il 300)

export COMPOSER_PROCESS_TIMEOUT=600
php composer.phar install --prefer-dist

答案 1 :(得分:0)

composer clearcache
composer clear-cache

只是为了澄清以上几行是清除作曲家缓存的内置方法。两个命令都是一样的。