doucha7329 2018-10-18 21:00
浏览 200

以某种方式安装composer,以便其他用户也可以使用其全局供应商目录,缓存等

Being a "root" user I install my composer like curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin -- --filename=composer which by default creates vendor-dir, cache etc inside /root/.composer. I want to install some global packages as root and let other users to use those packages. E.g

> whoami 
root
> composer global require hirak/prestissimo  (It makes packages download in parallel)
> su www-data
> cd /var/www/drupal
> composer install

Expected behaviour: It should download packages in parallel as install hirak/prestissimo globally but it does not. Because when I had installed that package it was inside /root/.composer/vendor and after switching to www-data it is not able to read/write /root/.composer/vendor

  • 写回答

1条回答 默认 最新

  • dousi2553 2018-10-18 22:28
    关注

    I would use bind mount, here is a post on stack exchange that covers it in far more detail then I can:

    https://unix.stackexchange.com/questions/198590/what-is-a-bind-mount

    I used it before to get out of CHROOT restrictions, for example C-Panel users are restricted to /home/user so they can't access anything above that. With bind mount, you can link a folder from above that to a folder in their Jail.

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度