美文网首页
【Composer】国内镜像使用

【Composer】国内镜像使用

作者: 马蹄哒 | 来源:发表于2020-03-24 10:53 被阅读0次

1. 全局配置

composer config -g repo.packagist composer https://packagist.phpcomposer.com

2. 仅在项目中使用

#需在项目的composer.json目录执行
composer config repo.packagist composer https://packagist.phpcomposer.com

取消镜像

composer config -g --unset repos.packagist

使用国内镜像安装laravel 示例

composer create-project -vv --prefer-dist laravel/laravel myapp

如果指定国内镜像,下载会很慢,如下面的情况,一直卡住

Installing laravel/laravel (v7.0.0)
  - Installing laravel/laravel (v7.0.0): Loading from cache
 Extracting archiveCreated project in myapp
> post-root-package-install: @php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies (including require-dev)

这时候可以Ctrl + c暂时终止安装,然后,为项目手动设置镜像

cd myapp
composer config repo.packagist composer https://packagist.phpcomposer.com

最后,重新安装,会快很多

composer install
php artisan key:generate
php artisan serve

相关文章

  • ThinkPHP5.1构建Restful风格API

    下载安装composer composer使用国内镜像 通过composer安装ThinkPHP5.1 通过com...

  • 学习笔记

    composer 切换国内镜像: 使用方法: packagist composer require 作者名/扩展包...

  • composer

    1:使用国内镜像 1: composer config -g repo.packagist composer ht...

  • 【Composer】国内镜像使用

    1. 全局配置 2. 仅在项目中使用 取消镜像 使用国内镜像安装laravel 示例 如果指定国内镜像,下载会很慢...

  • Composer安装Laravl遇到的坑

    1.composer 版本太低~~~经常提示没有composer.json文件2.composer使用国内镜像 c...

  • 初识laravel

    1、composer中国镜像 2、全局使用composer中国镜像 3、使用composer安装laravel5....

  • Composer 部署laravel框架

    使用composer方式部署laravel项目 第一步:切换镜像为国内镜像镜像官网:https://pkg.php...

  • composer国内镜像

    安装 php composer 国内镜像列表 镜像名地址赞助商更新频率备注阿里云 Composer 镜像https...

  • composer 国内镜像

    composer config -g repo.packagist composer https://mirror...

  • composer 国内镜像

    中国全量镜像 阿里云 提供实时同步,5秒更新 华为云 腾讯云

网友评论

      本文标题:【Composer】国内镜像使用

      本文链接:https://www.haomeiwen.com/subject/qrznyhtx.html