天天看點

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