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

kossiecoder's avatar

How can I install 5.8 laravel?

In order to install old version (5.8) of Laravel,

composer create-project --prefer-dist laravel/laravel blog "5.8.*"

I ran the command above.

However, after installing composer to 2 and php to 8 on my local (macbook), I am not able to install old version using above command.

[InvalidArgumentException]
  Could not find package laravel/laravel with version 5.8.* in a version ins
  tallable using your PHP version, PHP extensions and Composer version.

and I get the error message.

Is there a way to install 5.8 laravel using composer 2 and php 8 on my mac?

0 likes
7 replies
rovshena's avatar
C:\xampp\htdocs
λ composer create-project laravel/laravel blog "5.8.*"
Creating a "laravel/laravel" project at "./blog"
Installing laravel/laravel (v5.8.35)
  - Downloading laravel/laravel (v5.8.35)
  - Installing laravel/laravel (v5.8.35): Extracting archive
Created project in C:\xampp\htdocs\blog
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies
Lock file operations: 86 installs, 0 updates, 0 removals
  - Locking beyondcode/laravel-dump-server (1.3.0)
  - Locking dnoegel/php-xdg-base-dir (v0.1.1)
  - Locking doctrine/inflector (1.4.3)
  - Locking doctrine/instantiator (1.4.0)
.
.
.
  - Locking theseer/tokenizer (1.2.0)
  - Locking tijsverkoyen/css-to-inline-styles (2.2.3)
  - Locking vlucas/phpdotenv (v3.6.8)
  - Locking webmozart/assert (1.10.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 86 installs, 0 updates, 0 removals
  - Downloading symfony/var-dumper (v4.4.21)
  - Downloading symfony/routing (v4.4.20)
  - Downloading symfony/http-foundation (v4.4.20)
  - Downloading symfony/error-handler (v4.4.21)
  - Downloading symfony/http-kernel (v4.4.21)
.
.
.

  - Downloading phpunit/php-code-coverage (6.1.4)
  - Downloading phpunit/phpunit (7.5.20)
  - Installing symfony/polyfill-php80 (v1.22.1): Extracting archive
  - Installing symfony/polyfill-php72 (v1.22.1): Extracting archive
  - Installing symfony/polyfill-mbstring (v1.22.1): Extracting archive
  - Installing symfony/var-dumper (v4.4.21): Extracting archive
  - Installing symfony/polyfill-ctype (v1.22.1): Extracting archive
.
.
.
  - Installing phar-io/manifest (1.0.3): Extracting archive
  - Installing myclabs/deep-copy (1.10.2): Extracting archive
  - Installing phpunit/phpunit (7.5.20): Extracting archive
76 package suggestions were added by new dependencies, use `composer suggest` to see details.
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
54 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> @php artisan key:generate --ansi
Application key set successfully.

C:\xampp\htdocs
λ composer --version
Composer version 2.0.11 2021-02-24 14:57:23

C:\xampp\htdocs
λ php -v
PHP 7.4.12 (cli) (built: Oct 27 2020 17:18:47) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

rovshena's avatar
C:\xampp\htdocs
λ composer --version
Composer version 2.0.11 2021-02-24 14:57:23
C:\xampp\htdocs
λ php -v
PHP 7.4.12 (cli) (built: Oct 27 2020 17:18:47) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
kossiecoder's avatar

I think php 8 was the problem.

I switched to 7.4 and it works.

1 like
Tray2's avatar

Why use 5.8 for a new project?

1 like
kossiecoder's avatar

Few years ago, I made Laravel basic videos with 5.8 on my youtube channel for Koreans who want to learn Laravel and I recommended people using 5.8 to have exactly same environment as me. However, one of the watcher mentioned that laravel 5.8 couldn't be installed using that command. That's why I asked here.

For myself, I use latest version of Laravel all the time for new project :D

Tray2's avatar

Ok, that is a valid reason, You probably should update those videos ;)

ColmenaInteractive's avatar

I have the same problem here, a 5.8 laravel project and I can't install it in a new computer. I put php 7.4.33 with valet php, but the I can't install it. Can someone help me please?

PHP 7.4.33 (cli) (built: Apr 26 2023 18:36:16) ( NTS )
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install facade/ignition 2.12.1 (conflict analysis result)
    - Conclusion: don't install facade/ignition 2.14.1 (conflict analysis result)
    - Conclusion: don't install facade/ignition 2.17.7 (conflict analysis result)
    - Root composer.json requires facade/ignition ^2.10 -> satisfiable by facade/ignition[2.10.0, ..., 2.17.7].
    - Conclusion: don't install laravel/framework v5.8.1 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.2 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.3 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.4 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.5 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.6 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.7 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.8 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.9 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.10 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.11 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.12 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.13 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.14 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.15 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.16 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.17 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.18 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.19 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.20 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.21 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.22 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.23 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.24 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.25 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.26 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.27 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.28 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.29 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.30 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.31 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.32 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.33 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.34 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.35 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.36 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.37 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.38 (conflict analysis result)
    - Conclusion: don't install laravel/framework v5.8.0 (conflict analysis result)
    - facade/ignition[2.10.0, ..., 2.10.2] require illuminate/support ^7.0|^8.0 -> satisfiable by illuminate/support[v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev].
    - Only one of these can be installed: illuminate/support[v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev, v10.0.0, ..., 10.x-dev], laravel/framework[v5.8.0, ..., 5.8.x-dev]. laravel/framework replaces illuminate/support and thus cannot coexist with it.
    - Root composer.json requires laravel/framework 5.8.* -> satisfiable by laravel/framework[v5.8.0, ..., 5.8.x-dev].

My composer.json

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.1.3",
        "anhskohbo/no-captcha": "^3.1",
        "facade/ignition": "^2.10",
        "fideloper/proxy": "^4.0",
        "hashids/hashids": "^4.0",
        "intervention/image": "^2.5",
        "jeremykenedy/laravel-https": "^1.1",
        "laravel/framework": "5.8.*",
        "laravel/tinker": "^1.0",
        "laravelcollective/html": "^5.8.0",
        "league/flysystem-aws-s3-v3": "~1.0",
        "maatwebsite/excel": "~2.1.0"
    },
    "require-dev": {
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^3.0",
        "phpunit/phpunit": "^7.5"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

Please or to participate in this conversation.