天天看点

phpstudy 中使用 composer 遇到的问题

  • 问题描述

    [Composer\Downloader\TransportException] The "https://mirrors.aliyun.com/composer/packages.json" file could not be downloaded: allow_url_fopen must be enabled in php.ini (https:// wrapper is disabled in the server configuration by allow_url_fopen=0 failed to open stream: no suitable wrapper could be found)

  • 问题解决

    php.ini

    中搜索

    allow_url_fopen

    将其修改为

    allow_url_fopen=on

  • 其他

    推荐使用阿里镜像

    composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

    ,使用

    composer config -g --unset repo.packagist

    取消

    repo.packagist