php composer需要什么目录和权限才能进行composer install? [英] What directories and permission does php composer require for `composer install`?

查看:69
本文介绍了php composer需要什么目录和权限才能进行composer install?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试与特定用户一起运行 composer install .但是我遇到了权限错误:

I'm trying to run composer install with the specific user. However I run into permission errors:

$ composer install
Cannot create cache directory /var/www/.cache/composer/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /var/www/.cache/composer/files/, or directory is not writable. Proceeding without cache
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 118 installs, 0 updates, 0 removals

                                                                 
  [RuntimeException]                                             
  /var/www/html/vendor does not exist and could not be created.

那么/var/www/.cache -这是〜/.cache 吗?是否有明确的列表,需要哪些目录和权限?

So /var/www/.cache - is this meant to be ~/.cache? Is there a definitive list what directories and permissions are required?

作曲家版本:

Composer version 2.0.8 2020-12-03 17:20:38

推荐答案

在上述特殊情况下,我需要:

In my particular case above I needed:

/var/www/html/vendor
/var/www/html/public
/var/www/html/var/log/
/var/www/html/var/cache/

以上目录以 www-data:www-data 拥有,并具有 766 权限.尽管可能具有 700 权限会更安全.

The above directories owned as www-data:www-data with 766 permission. Though potentially 700 permissions would be more secure.

这篇关于php composer需要什么目录和权限才能进行composer install?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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