Skip to content

Commit

Permalink
Ensure correct PHP version is set
Browse files Browse the repository at this point in the history
Background: #1354

#1355 fixed half of this problem,
but there's still situations where php-cli ends up defaulting to 8.1.

This ensures the correct version of PHP is always set based on
`php_version` by using the `update-alternatives` command.
  • Loading branch information
swalkinshaw committed Feb 15, 2022
1 parent 91385fa commit c41bb8d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions roles/php/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
install_recommends: no
with_dict: "{{ php_extensions }}"

- name: Ensure correct PHP version selected
community.general.alternatives:
name: php
path: /usr/bin/php{{ php_version }}

- name: Start php fpm service
service:
name: "php{{ php_version }}-fpm"
Expand Down

0 comments on commit c41bb8d

Please sign in to comment.