composer 使用报错,连接异常
由于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