Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

qwertynik's avatar

How install Laravel version 8

Given the availability of Laravel 10, it is not ideal to install Laravel 8. However, since the server is running PHP 7.4.x, installing the latest version of Laravel is not possible. Any ideas how to do this? When doing this via composer, it fails with this error.

Command: composer create-project laravel/laravel demosBackend/

Could not fetch https://api.github.com/repos/laravel/laravel/zipball/843a4f81eb25b88b225a89d75a2d3c274e81be6b, please review your configured GitHub OAuth token or enter a new one to access private repos
When working with _public_ GitHub repositories only, head to https://github.com/settings/tokens/new?scopes=&description=Composer+on+DESKTOP-B3CS5F7+2023-04-28+1240 to retrieve a token.

From the error, it appears that the older version of Laravel is in a private repo. Any ideas how to install Laravel version 8.x?

0 likes
6 replies
frankielee's avatar

managed to install Laravel 8 using the following command.

composer create-project --prefer-dist laravel/laravel:^8.0 l5

Also, make sure you are using composer version ^2.0

1 like
qwertynik's avatar

@frankielee Had attempted a similar command earlier. This does not work.

Below error is thrown:

Could not fetch https://api.github.com/repos/laravel/laravel/zipball/843a4f81eb25b88b225a89d75a2d3c274e81be6b, please review your configured GitHub OAuth token or enter a new one to access private repos
When working with _public_ GitHub repositories only, head to https://github.com/settings/tokens/new?scopes=&description=Composer+on+DESKTOP-B3CS5F7+2023-04-30+1432 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-B3CS5F7+2023-04-30+1432
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 "/home/nik/.config/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):

Verified that composer version is 2 or higher.

nik@DESKTOP:~$ composer --version
Composer version 2.2.6 2022-02-04 17:00:38

Can you confirm if the command works on your end?

qwertynik's avatar

@frankielee The token is already set in the json file. Looks like there could be a problem with the token. Will generate a new token and attempt this again.

Tried this command on an ec-2 instance and it works. So repo being private is not an issue here. composer create-project laravel/laravel . "7.30.*" --prefer-dist

frankielee's avatar

@qwertynik I have no idea then, maybe there is some setting issues at your PC? since you managed to install at the ec-2 instance.

Can you confirm if the command works on your end?

Its working on my both window and linux OS

qwertynik's avatar

@frankielee Yes, there was an issue with the local setup. Despite having an active token, there was a failure. Generated a new token and used it. And lo it worked! Should have trusted the error message. Still strange that the existing token wasn't working. Something about the existing token in the error message should have helped in trusting the message more.

Please or to participate in this conversation.