Yii2: Doesn't support >=PHP 5.4, but officially sates it does!

Created on 12 Nov 2020  路  3Comments  路  Source: yiisoft/yii2

What steps will reproduce the problem?

Run with PHP 5.4 OR 5.6

What is the expected result?

Welcome install page.

What do you get instead?

Parse error: syntax error, unexpected ':', expecting '{' in C:\wamp\www\basic\vendor\symfony\polyfill-php80\bootstrap.php on line 23

Additional info

Throughout the official documentation Yii2 is stated to work with PHP version >=5.4.
After installing and running the requirements.php file, it also states that my minimum (PHP 5.6) has passed.
But this simply isn't true, because composer.lock shows multiple includes (mostly Symfony components) which require PHP 7+

I think the docs/requirements.php checker, should be updated to reflect the current, true, minimum requirements so as not to potentially confuse and waste anyone's time when considering Yii2 as a framework.

| Q | A
| ---------------- | ---
| Yii version | 2.0.1
| PHP version | 5.6
| Operating system | Win10

Most helpful comment

Could it be that you ran composer with a PHP version 7.1 or up and therefor pulled in incompatible packages for PHP 5?

Anddd, you are correct! My environment variable php path is set to PHP 7, I had no idea composer uses that to modify the install. I have Wamp installed to run PHP 5.6 apps. Thanks... great call.

All 3 comments

Could it be that you ran composer with a PHP version 7.1 or up and therefor pulled in incompatible packages for PHP 5?

The framework itself works well on PHP 5.4. Do you mean https://github.com/yiisoft/yii2-app-basic/?

Could it be that you ran composer with a PHP version 7.1 or up and therefor pulled in incompatible packages for PHP 5?

Anddd, you are correct! My environment variable php path is set to PHP 7, I had no idea composer uses that to modify the install. I have Wamp installed to run PHP 5.6 apps. Thanks... great call.

Was this page helpful?
0 / 5 - 0 ratings