composer 使用报错,连接异常

qq_22237055 2019-08-27 03:16:26
由于composer异常,重新安装了一边composer,并且使用了中国镜像,但是composer依然报错,但是根据ping的结果看来不存在被墙的原因

qi@qi-ideacentre-AIO-300-23ISU:/var/www/html$ composer create-project --prefer-dist laravel/laravel blog "5.7.*"

[Composer\Downloader\TransportException]
The "https://repo.packagist.org/p/laravel/laravel.json" file could not be d
ownloaded: failed to open stream: Connection timed out

系统环境 ubuntu 16.04.1
php环境 php7.1

安装步骤:
1.php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
2.php composer-setup.php
3.sudo mv composer.phar /usr/local/bin/composer
4.composer config -g repo.packagist composer https://packagist.phpcomposer.com

目前composer config

[repositories.packagist.org.type] composer
[repositories.packagist.org.url] https://packagist.phpcomposer.com
[process-timeout] 300
[use-include-path] false
[preferred-install] auto
[notify-on-install] true
[github-protocols] [https, ssh]
[vendor-dir] vendor (/var/www/html/vendor)
[bin-dir] {$vendor-dir}/bin (/var/www/html/vendor/bin)
[cache-dir] /home/qi/.cache/composer
[data-dir] /home/qi/.local/share/composer
[cache-files-dir] {$cache-dir}/files (/home/qi/.cache/composer/files)
[cache-repo-dir] {$cache-dir}/repo (/home/qi/.cache/composer/repo)
[cache-vcs-dir] {$cache-dir}/vcs (/home/qi/.cache/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
[use-github-api] true
[home] /home/qi/.config/composer


...全文
621 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
yt_php 2019-10-05
  • 打赏
  • 举报
回复
中国镜像本来就可能不成功,换源composer config -g repo.packagist composer https://packagist.laravel-china.org
fanfan_y 2019-10-05
  • 打赏
  • 举报
回复
要安装什么?大多数软件可以通过git方法克隆下来的,或者你把网络切换到手机网络上,也就是电脑连接手机当初的无线信号,这样成功率很大

4,251

社区成员

发帖
与我相关
我的任务
社区描述
国内外优秀PHP框架讨论学习
社区管理员
  • Framework
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧