curl command cannot get contents from api.github, but the network is fine

1.8k views Asked by At

I was trying use command composer create-project laravel/laravel Laravel, to create a new laravel project.

But I got this in the terminal:

Failed to download jakub-onderka/php-console-color from dist: The "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/e0b393dacf7703fc36a4efc3df1435485197e6c1" file could not be downloaded: failed to open stream: Connection timed out
    Now trying to download from source

Then, I tried this command:

curl https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/e0b393dacf7703fc36a4efc3df1435485197e6c1

It cannot work.

However, when I entered the address in the browser(FireFox), It works!

What's wrong with that? Have suffered from this couple of days.

0

There are 0 answers