W
W
WebDev2019-08-21 17:38:21
Laravel
WebDev, 2019-08-21 17:38:21

Laravel 5.8 requires php7.2?

The laravel 5.8 documentation states that PHP >= 7.1.3 is required.
However composer install throws an error


Problem 1
- Installation request for doctrine/lexer 1.1.0 -> satisfiable by doctrine/lexer[1.1.0].
- doctrine/lexer 1.1.0 requires php ^7.2 -> your PHP version (7.1.17) does not satisfy that requirement.
Problem 2
- doctrine/lexer 1.1.0 requires php ^7.2 -> your PHP version (7.1.17) does not satisfy that requirement.
- egulias/email-validator 2.1.11 requires doctrine/lexer ^1.0.1 -> satisfiable by doctrine/lexer[1.1.0].
- Installation request for egulias/email-validator 2.1.11 -> satisfiable by egulias/email-validator[2.1.11].

Is there any way to get around this without updating php?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrew, 2019-08-21
@deepblack

In your project's composer.json, check for a version of doctrine/lexer that doesn't require PHP 7.2
Looking at the content of composer.json EmailValidator
you can tell it requires doctrine/lexer "^1.0.1"
And lexer 1.0.1 works on php: >=5.3.2

{
  "name":         "egulias/email-validator",
  "description":  "A library for validating emails against several RFCs",
  "homepage":     "https://github.com/egulias/EmailValidator",
  "type":         "Library",
  "keywords":     ["email", "validation", "validator", "emailvalidation", "emailvalidator"],
  "license":      "MIT",
  "authors": [
    {"name": "Eduardo Gulias Davis"}
  ],
  "extra": {
    "branch-alias": {
      "dev-master": "2.1.x-dev"
    }
  },
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/dominicsayers/isemail"
    }
  ],
  "require":      {
    "php": ">= 5.5",
    "doctrine/lexer": "^1.0.1"
  },
  "require-dev" :   {
    "satooshi/php-coveralls": "^1.0.1",
    "phpunit/phpunit": "^4.8.35||^5.7||^6.0",
    "symfony/phpunit-bridge": "^[email protected]",
    "dominicsayers/isemail": "dev-master"
  },
  "suggest": {
    "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation"
  },
  "autoload": {
    "psr-4": {
      "Egulias\\EmailValidator\\": "EmailValidator"
    }
  },
  "autoload-dev": {
    "psr-4": {
      "Egulias\\Tests\\": "test"
    }
  }
}

S
SergeRod, 2019-08-22
@SergeRod

In the config section of your project's composer.json file, specify the target PHP version in your platform configuration.
It should look something like this:

"config": {
    "platform": {"php": "7.1.0"},
}

Composer will try to find suitable package versions that are compatible with that platform. Or swear if you can't find it.

M
metajiji, 2019-08-23
@metajiji

Now things like Docker, systemd-nspawn, lxc, scl, and finally hand-built Pykh and a bunch of other options in our modern cultural society are available :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question