Getting Error: Your PHP installation appears to be missing the MySQL extension which is required by WordPress

Trying to build my local environment after an upgrade to my OS to Monterey.

First problem was nfs timing out, which was solved by changing the vagrant_ip as suggested in this thread: MacOS Monterey update: Can't vagrant up anymore, "mount.nfs: Connection timed out" - #4 by MWDelaney

Now I’m getting the “missing MySQL extension” error.

I may have bigger problems too. I’m installing php 7.4 in my /roles/php/tasks/main.yml:

---
- name: Add PHP 7.4 PPA
  apt_repository:
    repo: "ppa:ondrej/php"
    update_cache: yes

- name: Install PHP 7.4
  apt:
    name: "{{ item.key }}"
    state: "{{ item.value }}"
    cache_valid_time: "{{ apt_cache_valid_time }}"
  with_dict: "{{ php_extensions }}"

When I vagrant ssh into the vm after the attempt to build the project, i get the following output:

$ php -v
PHP 8.1.7 (cli) (built: Jun 25 2022 08:12:27) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.7, Copyright (c), by Zend Technologies

The hard-coded PHP version indicates that you are using a quite outdated version of Trellis:

You are correct with the age of my trellis. The last update i did was bringing in the php7.4 changes a year or so ago. The project is an old one that I am maintaining.

I’m confused as to why the php version I’ve specified in my main.yml (hard-coded yes) isn’t being built now when i do a vagrant up and I’m getting v8.1.7 in the environment.

I see there is a commit removing the hard-coded versions. I found that here: Improve handling of PHP versions · roots/trellis@5f398b2 · GitHub

I may bring this change in and give it a go.