Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

nitro apply does not change cli php version #192

Closed
tmulry opened this issue Jul 30, 2020 · 2 comments
Closed

nitro apply does not change cli php version #192

tmulry opened this issue Jul 30, 2020 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@tmulry
Copy link

tmulry commented Jul 30, 2020

Description

If I change the version of an existing machine using nitro apply, the version used by the cli does not automatically downgrade.

Steps to reproduce

  1. Create new machine using php 7.4

$ nitro init -m nitro-php
Initialize the primary machine now? [yes]
How many CPU cores? [4] 2
How much memory? [4G] 2G
How much disk space? [40G] 10G
Which version of PHP? [7.4]
Which database engine? [mysql]
Which version of mysql? [5.7]
Applying the changes now...

  1. in nitro-php.yaml, change php 7.4 to 7.3
  2. run nitro apply
  3. after install completes, run multipass exec nitro-php -- php --version
    expected:
    version is php 7.3
    actual:
    version is still 7.4

Additional info

  • Nitro version:nitro 1.0.0-beta.10
  • Multipass version:multipass 1.3.0+mac

I ended up using these commands to switch the version manually:

multipass exec nitro-php -- sudo update-alternatives --set php /usr/bin/php7.3
multipass exec nitro-php -- sudo update-alternatives --set phar /usr/bin/phar7.3
multipass exec nitro-php -- sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.3
multipass exec nitro-php -- sudo update-alternatives --set phpize /usr/bin/phpize7.3
multipass exec nitro-php -- sudo update-alternatives --set php-config /usr/bin/php-config7.3

@tmulry tmulry added the bug Something isn't working label Jul 30, 2020
@jasonmccallister jasonmccallister self-assigned this Jul 30, 2020
@jasonmccallister
Copy link
Member

@tmulry thank you! I'm going to put this on the todo list!

@jasonmccallister jasonmccallister added this to the 1.0 milestone Jul 30, 2020
@jasonmccallister
Copy link
Member

@tmulry I made some changes to the apply and plan to test and get this in the next release. Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants