Skip to content

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

@mpdude

Description

@mpdude

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions