【问题标题】:file_put_contents(config.json): failed to open stream: No such file or directoryfile_put_contents(config.json):无法打开流:没有这样的文件或目录
【发布时间】:2014-09-05 05:19:30
【问题描述】:

我正在尝试使用私有存储库更新作曲家:

php composer.phar update

An existing OAuth token for Composer is present and will be reused [ErrorException] file_put_contents(/srv/data/.composer/config.json): failed to open stream: No such file or directory

我的用户不允许写入此目录/srv/data/

我的问题是如何更改config.json 目录?

我试过了:

 php.composer.phar config --list

 [repositories.0.type] vcs
 [repositories.0.url] https://github.com/*****/*******.git
 [repositories.packagist.type] composer
 [repositories.packagist.url] https?://packagist.org
 [repositories.packagist.allow_ssl_downgrade] true
 [process-timeout] 300
 [use-include-path] false
 [preferred-install] auto
 [notify-on-install] true
 [github-protocols] [git, https, ssh]
 [vendor-dir] vendor
 [bin-dir] bin
 [cache-dir] /srv/data/.composer/cache
 [cache-files-dir] {$cache-dir}/files (/srv/data/.composer/cache/files)
 [cache-repo-dir] {$cache-dir}/repo (/srv/data/.composer/cache/repo)
 [cache-vcs-dir] {$cache-dir}/vcs (/srv/data/.composer/cache/vcs)
 [cache-ttl] 15552000
 [cache-files-ttl] 15552000
 [cache-files-maxsize] 300MiB (314572800)
 [discard-changes] false
 [autoloader-suffix]
 [optimize-autoloader] false
 [prepend-autoloader] true
 [github-domains] [github.com]
 [store-auths] prompt
 [home] /srv/data/.composer

 php composer.phar config home  /srv/data/web/vhsots/monsiteweb/
 [InvalidArgumentException]
 Setting home does not exist or is not supported by this command
 config [-g|--global] [-e|--editor] [-a|--auth] [--unset] [-l|--list] [-f|--file="..."]    [setting-key] [setting-value1] ... [setting-valueN]

【问题讨论】:

标签: json directory config composer-php


【解决方案1】:

您可以使用COMPOSER_HOME 环境变量更改作曲家目录的位置。

COMPOSER_HOME=/some/writable/path php composer.phar update

【讨论】:

    猜你喜欢
    • 2015-11-14
    • 2017-07-06
    • 2013-01-24
    • 2018-12-01
    • 2018-04-08
    • 2018-09-20
    • 2019-06-03
    • 2018-10-03
    • 2017-05-04
    相关资源
    最近更新 更多