Álvaro González
Álvaro González

Reputation: 146410

Upgrade library for different PHP version

I've a legacy project that runs on PHP/5.3.3 (production). I need to upgrade phpmyadmin/motranslator from 3.3 to 4.0 to apply a bugfix. I runComposer locally and then upload via FTP.

If I run PHP/5.3 locally then download fails due to a SSL error:

Downloading (failed)    Update failed (The "https://api.github.com/repos/symfony/expression-language/zipball/422bf02386ab46f615d1d784b771599357461d73"
file could not be downloaded: SSL operation failed with code 1.
OpenSSL Error messages:
    error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
    Failed to enable crypto
    failed to open stream: operation failed)

If I run a later version:

This package requires php ~5.3.0 but your PHP version (7.2.3) does not satisfy that requirement

The --ignore-platform-reqs switch installs dependencies that require PHP/7 and won't run in production.

If feel that the platform option is the way to go but I can't grasp it:

{
    "require": {
        "php": "~5.3.0",
        "phpmyadmin/motranslator": "^4.0",
        "ptlis/conneg": "^4.0"
    },
    "config": {
        "platform": {
            "php": "5.3.3"
        }
    }
}

… triggers a hundred lines like these:

symfony/expression-language v4.0.7 requires php ^7.1.3 -> your PHP version (7.2.3) overridden by "config.platform.php" version (5.3.3) does not satisfy that requirement

How should I proceed?

Upvotes: 0

Views: 845

Answers (2)

Álvaro González
Álvaro González

Reputation: 146410

I suspect that motranslator requirements don't consider dependencies properly:

"require": {
    "php": ">=5.3.0",
    "symfony/expression-language": "^4.0 || ^3.2 || ^2.8"
},

… but oldest supported expression-language requirements say:

"require": {
    "php": ">=5.3.9"
},

This probably explains some of my troubles. I'm sharing this as alternative answer because it kind of deviates from the original question.

Upvotes: 0

Edi Modrić
Edi Modrić

Reputation: 2310

The error is due to an older version of OpenSSL bundled with your PHP installation.

Since you have platform config for PHP set at 5.3.3, everything should work if you just remove "php": "~5.3.0" from your composer.json file. This will allow composer install to proceed and install packages compatible with PHP 5.3.3.

Upvotes: 1

Related Questions