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

How to change the composer image source to Alibaba Cloud

藏色散人
Release: 2020-08-26 13:14:52
forward
3377 people have browsed it

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 缓存。
Copy after login

Current project replacement

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

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!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template