I live in Iran, in last days because of internet limitations, I couldn't push into GitHub or GitLab, and also I couldn't use composer.
for GitHub and GitLab, I try SSH connection and SSH access key and I have no problems yet! but I can't use composer.
when I try this
composer create-project laravel/laravel starter-app
I get this
Creating a "laravel/laravel" project at "./starter-app"
Info from https://repo.packagist.org: #StandWithUkraine
Cannot use laravel/laravel's latest version v9.3.8 as it requires PHP ^8.0.2 which is not satisfied by your platform.
Installing laravel/laravel (v8.6.12)
- Downloading laravel/laravel (v8.6.12)
- Downloading laravel/laravel (v8.6.12)
- Downloading laravel/laravel (v8.6.12)
- Downloading laravel/laravel (v8.6.12)
Failed to download laravel/laravel from dist: curl error 28 while downloading https://codeload.github.com/laravel/laravel/legacy.zip/843a4f81eb25b88b225a89d75a2d3c274e81be6b: Operation timed out after 10000 milliseconds with 0 out of 0 bytes received
Now trying to download from source
- Syncing laravel/laravel (v8.6.12) into cache
Cloning failed using an SSH key for authentication, enter your GitHub credentials to access private repos
When working with _public_ GitHub repositories only, head to https://github.com/settings/tokens/new?scopes=&description=Composer+on+DESKTOP-RRHGV12+2022-10-11+1350 to retrieve a token.
This token will have read-only permission for public information only.
When you need to access _private_ GitHub repositories as well, go to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+DESKTOP-RRHGV12+2022-10-11+1350
Note that such tokens have broad read/write permissions on your behalf, even if not needed by Composer.
Tokens will be stored in plain text in "C:/Users/VIRA-PC03/AppData/Roaming/Composer/auth.json" for future use by Composer.
For additional information, check https://getcomposer.org/doc/articles/authentication-for-private-packages.md#github-oauth
Token (hidden):
I go to this link "https://getcomposer.org/doc/articles/authentication-for-private-packages.md#github-oauth" and generate new token and paste it, but nothing happen and also I can't use composer
also I try this command
composer diagnose
and get this
Checking platform settings: OK
Checking git settings: OK git version 2.29.2
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com oauth access: FAIL
[Composer\Downloader\TransportException] curl error 28 while downloading https://api.github.com/: Operation timed out after 10000 milliseconds with 0 out of 0 bytes received
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: some number with spaces
Dev Public Key Fingerprint: some number with spaces
OK
Checking composer version: FAIL
[Composer\Downloader\TransportException] curl error 28 while downloading https://getcomposer.org/versions: Operation timed out after 10008 milliseconds with 0 out of 0 bytes received
Composer version: 2.4.2
PHP version: 7.4.12
PHP binary path: C:\xampp\php\php.exe
OpenSSL version: OpenSSL 1.1.1h 22 Sep 2020
cURL version: 7.70.0 libz 1.2.11 ssl OpenSSL/1.1.1h
zip: extension present, unzip not available, 7-Zip not available
and I go to C:\users<my-user>\AppData\Roaming\composer and create file "auth.json" and put this into it
{
"github-oauth": {
"github.com": "my token"
}
}
but I can't get or install Laravel or any other package like phpspeadsheet using composer.