-1

I am getting the following error when run composer commands.

/opt/plesk/php/7.4/bin/php -d memory_limit=-1 /usr/lib/plesk-9.0/composer.phar update

This only appears when the command is run by a code deployment service I have setup (DeployHQ). When I run the same composer commands via the command line, SSH, the errors do not appear.

Regarding the mcrypt errors. The mycrypt module was not installed. Tried installing this, but the error persists.

Regarding the "During inheritance of..." error, I cannot replicate this anywhere. I am specifying PHP 7.4 when running the composer command. This sounds like a PHP 8 issue.
It only appears when the deployment service runs the composer commands. One thing I noticed is that when the deployment service runs the composer commands, it downgrades "laminas/laminas-dependency-plugin" from v2.4 to 2.2. Which is correct for the Magento version I have (2.4.2), but why this downgrade does not happen when I run the composer commands I have no idea. If anyone can shed any light on what could be the issue here, and maybe point me in the right direction.

PHP Deprecated: Return type of phpseclib_mcrypt_filter::filter($in, $out, &$consumed, $closing) should either be compatible with php_user_filter::filter($in, $out, &$consumed, bool $closing): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rftlve.raftfurniture.co.uk/rftstg.raftfurniture.co.uk/httpdocs/releases/20240913132334/vendor/phpseclib/mcrypt_compat/lib/mcrypt.php on line 1107PHP Deprecated: Return type of phpseclib_mcrypt_filter::onCreate() should either be compatible with php_user_filter::onCreate(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rftlve.raftfurniture.co.uk/rftstg.raftfurniture.co.uk/httpdocs/releases/20240913132334/vendor/phpseclib/mcrypt_compat/lib/mcrypt.php on line 1158PHP Deprecated: Return type of phpseclib_mcrypt_filter::onClose() should either be compatible with php_user_filter::onClose(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rftlve.raftfurniture.co.uk/rftstg.raftfurniture.co.uk/httpdocs/releases/20240913132334/vendor/phpseclib/mcrypt_compat/lib/mcrypt.php on line 1221PHP Fatal error: During inheritance of SplDoublyLinkedList: Uncaught Exception: Deprecated Functionality: Return type of Laminas\Di\DefinitionList::push($definition) should either be compatible with SplDoublyLinkedList::push(mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rftlve.raftfurniture.co.uk/rftstg.raftfurniture.co.uk/httpdocs/releases/20240913132334/vendor/laminas/laminas-di/src/DefinitionList.php on line 71 in /var/www/vhosts/rftlve.raftfurniture.co.uk/rftstg.raftfurniture.co.uk/httpdocs/releases/20240913132334/vendor/magento/framework/App/ErrorHandler.php:61

3
  • Are you sure this problem is in any way related to Composer itself, or to any deployment? To me it looks like Composer is not run with PHP 7.4 after all (as this would not generate a message containing "#[\ReturnTypeWillChange] attribute")
    – Nico Haase
    Commented Sep 17 at 5:48
  • Also, is there any reason to use an outdated version of Magento? The latest one is 2.4.7, which includes some security bug fixes
    – Nico Haase
    Commented Sep 17 at 5:49
  • Hi, it was down to deployment using PHP8, not 7.4. The reason we are using 7.4, is because the site is on 2.4.2....we are not able to fully upgrade to 2.4.7 yet due to some modules requiring updating.
    – Shaun
    Commented Sep 18 at 7:26

1 Answer 1

0

For some reason, when the deployment service connects via SSH, the CLI PHP version was version 8. There is a reason we are having to use PHP 7.4 at the moment. Updated the SSH commands to ref PHP 7.4 exe, and it resolved the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.