Failed to install from archive: Your Composer dependencies require a PHP version

I installed YII 2.0.39 from the archive:

  1. Downloaded yii-basic-app-2.0.39.tgz

  2. Unzipped the file.

  3. Sent to the WEB server (hosting, not localhost): http: // mywebserver / myYII

  4. In the file config / web.php in the cookieValidationKey inserted
    secret key in GUID format - generated by myself.

  5. Launched http: //mywebserver/myYII/basic/requirements.php
    Got: Your server configuration satisfies the minimum requirements by this application.

  6. Launched http: //mywebserver/myYII/basic/web/index.php
    Got: Fatal error: Composer detected issues in your platform:
    Your Composer dependencies require a PHP version “> = 7.2.0”.
    You are running 7.0.33.

But I cannot reinstall PHP!
Question: What can be done?
Thanks.

  1. Install it via Composer.
  2. Remove Codeception that requires modern PHP.
  3. Lower requirement in composer.json.

samdark
Is it (1) or (2) or (3) ?
Or is it (1) and (2) and (3) ?

I have just started learning Yii and unfortunately
I don’t know what Codeception is and how to remove it.

Thanks.

(1) and (2) and (3) !

Read this guide for installation via composer

Removing codeception and lowering requirements are not Yii2 specific, but related with composer.

You should edit your composer.json file and remove the lines with codeception on it and change the "php": ">=7.2.0" line to something like "php": ">=7.0.0".

The best way to do though, would be to upgrade your PHP version to 7.2+ (if possible), then you would only need to install Yii2 via composer.