企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
![](https://img.kancloud.cn/c5/ed/c5ed1e657137607d1d0bb3046be32a90_818x257.png) 在网站--管理--cmposer选项中调出cli命令窗口 输入composer config -gl ``` D:\phpstudy_pro\WWW\www.demo1.com>composer config -gl [repositories.packagist.org.type] composer [repositories.packagist.org.url] https?://repo.packagist.org [repositories.packagist.org.allow_ssl_downgrade] true [process-timeout] 300 [use-include-path] false [preferred-install] auto [notify-on-install] true [github-protocols] [https, ssh] [vendor-dir] vendor (D:\phpstudy_pro\WWW\www.demo1.com/vendor) [bin-dir] {$vendor-dir}/bin (D:\phpstudy_pro\WWW\www.demo1.com/vendor/bin) [cache-dir] C:/Users/Administrator/AppData/Local/Composer [data-dir] C:/Users/Administrator/AppData/Roaming/Composer [cache-files-dir] {$cache-dir}/files (C:/Users/Administrator/AppData/Local/Compo ser/files) [cache-repo-dir] {$cache-dir}/repo (C:/Users/Administrator/AppData/Local/Compose r/repo) [cache-vcs-dir] {$cache-dir}/vcs (C:/Users/Administrator/AppData/Local/Composer/ vcs) [cache-ttl] 15552000 [cache-files-ttl] 15552000 [cache-files-maxsize] 300MiB (314572800) [bin-compat] auto [discard-changes] false [autoloader-suffix] [sort-packages] false [optimize-autoloader] false [classmap-authoritative] false [apcu-autoloader] false [prepend-autoloader] true [github-domains] [github.com] [bitbucket-expose-hostname] true [disable-tls] false [secure-http] true [cafile] [capath] [github-expose-hostname] true [gitlab-domains] [gitlab.com] [store-auths] prompt [archive-format] tar [archive-dir] . [htaccess-protect] true [home] C:/Users/Administrator/AppData/Roaming/Composer D:\phpstudy_pro\WWW\www.demo1.com> ``` 可知 全局配置文件在 ``` C:\Users\Administrator\AppData\Roaming\Composer\config.json ``` 全局配置 ~~~ composer config -g repo.packagist composer https://packagist.phpcomposer.com ~~~ 全局配置文件内容如下 ``` { "config": {}, "repositories": { "packagist": { "type": "composer", "url": "https://packagist.phpcomposer.com" } } } ``` composer config -gl 查看repositories.packagist.org.url的地址也改变了 ``` [repositories.packagist.org.url] https://packagist.phpcomposer.com ``` 设置全局配置镜像地址,然后再次安装,如果等一会还是慢,继续更换地址尝试: 中国全量镜像 ~~~ composer config -g repo.packagist composer https://packagist.phpcomposer.com ~~~ 腾讯云 ~~~ composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer/ ~~~ 阿里云 ~~~ composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ ~~~ ### 解除镜象 如果需要解除镜像并恢复到 packagist 官方源,请执行以下命令: ~~~ composer config -g --unset repos.packagist ~~~