Laravel Composer更新错误-权限被拒绝 [英] Laravel Composer Update Error - Permission Denied

查看:241
本文介绍了Laravel Composer更新错误-权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在更新作曲家时出现错误.这是我从....下载的Laravel 4项目,我第一次对其进行更新时,一切都很好,并且得到了更新.但是由于某种原因,我删除了用该项目的新副本替换它的方法,但是现在当我开始更新它时,它给了我以下错误:

I'm having error during updating composer. It's a Laravel 4 project which I've downloaded from .... and first time I updated it, it was fine and got updated. but due some reason I deleted that replace it with a fresh copy of that project, but now when I started to update it, it gives me the following error:

[ErrorException]                                                           
copy(/home/username/.composer/cache/files/symfony/security-core/3a27d7b34ee6  
2cb0fdf5ad970e7777912ef4722f.zip): failed to open stream: Permission denied

在此作曲家的第一次和第二次更新之间,我进行了以下操作:

In between first and second update of this composer I did the following:

  1. 试图安装Vagrant和Homestead,但由于某些Internet连接问题而失败.
  2. 更新的Composer失败
  3. 卸载了无业游民并重新安装作曲家.
  4. 重新安装的作曲家
  5. 更新的作曲家(成功)
  6. 试图安装流浪汉和宅基地(成功)
  7. 更新作曲家(失败)
  8. 未安装的无业游民
  9. 重新安装的作曲家
  10. Update Composer(失败)
  1. Tried to installed Vagrant and homestead, but failed due to some internet connection problem.
  2. Updated Composer failed
  3. Uninstalled vagrant and reinstall composer.
  4. Reinstalled Composer
  5. Updated composer (success)
  6. Tried to install vagrant and homestead (success)
  7. Update composer (failed)
  8. uninstalled vagrant
  9. Reinstalled Composer
  10. Update Composer (failed)

上述错误一次又一次发生.我也尝试了"composer clearcache",但是没有用.我注意到一件事,我使用作曲家已经16到19个月了,从未听说过此类错误,但是由于我尝试安装流浪汉,这给我带来了障碍和错误.

The above mentioned error is getting occured again and again. I also tried 'composer clearcache' but doesn't worked. One thing which I noticed that it's been 16-19 months I'm using composer and never heard of such errors, but since I tried to install vagrant it created hurdles and errors for me.

  • 我正在使用Ubuntu 15.04
  • 更新Laravel 4.0项目
  • 更新Laravel 5

这两个项目在安装vagrant和homestead之前都已更新,但现在不是. /var/www属于"www-data"组,而"username"也是该组的一部分.

both project got updated before installing vagrant and homestead, but not now. /var/www is under the group of 'www-data' and 'username' also the part of this group.

请帮助pz !!!!!!!!!!!!!!!

Any help plz!!!!!!!!!!!!!!!

推荐答案

我找到了解决方案.如果您看到错误,那么很显然我没有访问权限:

I found the solution. If you see the error then it would be clear that I don't had access to the:

 "/home/username/.composer/cache/files/symfony/security-core/3a27d7b34ee62cb0fdf5ad970e7777912ef4722f.zip".

当我浏览该目录时,我发现它的所有者是'root'或'sudo'.

When I explore this directory, I found that its owner is 'root' or 'sudo'.

所以我删除了'.composer'目录,然后开始在我的laravel项目目录中进行更新,一切都很好.没问题!

So I deleted the '.composer' directory and then started to update in my laravel project directory, every thing was fine and perfect! No problem at all!

这篇关于Laravel Composer更新错误-权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆