ByteInternet / hypernode-docker

Fast and easy Docker for Magento development
https://community.hypernode.io/hypernode-docker
35 stars 8 forks source link

PHP version for cli and fpm don't match #2

Closed frosit closed 6 years ago

frosit commented 6 years ago

The PHP version for PHP-CLI (7.1) does not match PHP-FPM (7.0).

php -v
#PHP 7.1.16-1 (cli) (built: May  3 2018 12:35:50) ( NTS )

echo "<?php echo PHP_VERSION;" > /data/web/public/index.php && curl localhost
#7.0.30-1

On startup, PHP-FPM7.0 is set by 60_restart_services.sh

grep /php /etc/my_init.d/60_restart_services.sh
#/usr/bin/screen -S hypernode_service_php -d -m /usr/sbin/php-fpm7.0 --nodaemonize --fpm-config /etc/php/7.0/fpm/php-fpm.conf

So my assumption is that PHP7.1 was active when the image was build. The startup script changed the version for PHP-FPM but not for PHP-CLI.

As described in the documentation, it can easily be changed by running the following as root:

sudo update-alternatives --set php $(which php7.0)
vdloo commented 6 years ago

good catch! new image will be out in about an hour, it will run php7.1 fpm by default now. thanks!

vdloo commented 6 years ago

the release-5313 image has this now