capistrano-magento2 icon indicating copy to clipboard operation
capistrano-magento2 copied to clipboard

Doesn't work with PHP 7.4 and Magento 2..42

Open walkwizus opened this issue 4 years ago • 4 comments

Hi !

With Magento 2.4.2 and PHP 7.4.X,t he deployment doesn't work due to php's version in update/ directory. I've tried to update the Magento updater with this documentation: https://devdocs.magento.com/guides/v2.3/comp-mgr/updater/update-updater.html but without success.

To resolve this issue, I've deleted the update/ folder and all works fine. Do you think it would be possible to add a parameter not to update the updater?

https://github.com/davidalger/capistrano-magento2/blob/master/lib/capistrano/tasks/magento.rake#L132

Thanks !

walkwizus avatar May 07 '21 07:05 walkwizus

You could also try:

SSHKit.config.command_map[:php] = "/usr/bin/php74"
SSHKit.config.command_map[:composer] = "/usr/bin/php74 /usr/local/bin/composer"
SSHKit.config.command_map[:magento] = "/usr/bin/php74 -f bin/magento --"

(If /usr/bin/php74 is the location of your php 7.4.x)

PascalBrouwers avatar Jul 22 '21 09:07 PascalBrouwers

Hi @PascalBrouwers , Can I have question? I try to check your guide on above but It's not working. I checked capistrano use ssh and php default running to build. I have multi PHP env on staging server, I need defined exactly PHP env. How can I set value SSHKit.config.command_map[:php] = "/usr/bin/php*" on deploy.rd. Thank you

kalumbum avatar Aug 10 '22 04:08 kalumbum

Just put it somewhere in the deploy.rd doesn't really matter where. Though it's better to put it in your config/[environment].rd

PascalBrouwers avatar Aug 10 '22 06:08 PascalBrouwers

Hi @PascalBrouwers,
I tried to add a command on file.rd. It's working now. Thanks for support

kalumbum avatar Aug 31 '22 04:08 kalumbum