Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add switch to run update-alternatives to set the managed PHP version as default #652

Open
mpdude opened this issue Jan 13, 2022 · 0 comments

Comments

@mpdude
Copy link
Contributor

mpdude commented Jan 13, 2022

Depending on which PHP version is installed with this module (and there might even be other versions not managed by it!), it's hard to predict what /usr/bin/php will resolve to.

At least on Ubuntu, the update-alternatives command can be used to control that. You need to be aware, however, that there are a few alternatives that need to be configured:

$ update-alternatives  --get-selections | grep ph
phar                           auto     /usr/bin/phar8.1
phar.phar                      auto     /usr/bin/phar.phar8.1
php                            auto     /usr/bin/php8.1
php-config                     auto     /usr/bin/php-config8.1
phpize                         auto     /usr/bin/phpize8.1

It would be nice if this module could encapsulate the necessary knowledge (which alternatives need to be set to what). Maybe an additional module (puppet/alternatives?) comes in handy?

class { '::php': update_alternatives => true } should set all php-related alternatives to the PHP version given in ::php::globals.

X-Ref #235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant