Home  >  Article  >  Development Tools  >  How to change the composer image source to Alibaba Cloud

How to change the composer image source to Alibaba Cloud

藏色散人
藏色散人forward
2020-08-26 13:14:523346browse

The following tutorial column of composer will introduce to you how to change the composer image source to Alibaba Cloud. I hope it will be helpful to friends in need!

How to change the composer image source to Alibaba Cloud

Let me talk about why I changed the mirror source. Today I am going to add an Excel export function to the company's project, and I need the PhpSpreadsheet plug-in to realize my function. When I entered the command, I found that I was prompted Authentication required (packagist.laravel-china.org):

what? This is what prompts me to need a username. No, this problem doesn't usually occur. I went to search Baidu and found that laravel-china's package mirror site was about to cease operations. This news was not very good. I have been using this mirror site for a long time and it is very good. Hey, people have persisted for two years, which is already very good. I have no choice but to replace it. The following are the steps I took to replace the Alibaba Cloud image:

Official website: https://developer.aliyun.com/composer

Global replacement

$ composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
$ composer clear-cache # 此步奏选泽性操作,清除所有 package 缓存。

Current project replacement

$ cd 项目目录
$ composer config repo.packagist composer https://mirrors.aliyun.com/composer/

The above is the detailed content of How to change the composer image source to Alibaba Cloud. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete