Skip to content

Commit c41bb8d

Browse files
committed
Ensure correct PHP version is set
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.
1 parent 91385fa commit c41bb8d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

roles/php/tasks/main.yml

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
install_recommends: no
1313
with_dict: "{{ php_extensions }}"
1414

15+
- name: Ensure correct PHP version selected
16+
community.general.alternatives:
17+
name: php
18+
path: /usr/bin/php{{ php_version }}
19+
1520
- name: Start php fpm service
1621
service:
1722
name: "php{{ php_version }}-fpm"

0 commit comments

Comments
 (0)