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

**URL:** https://discourse.roots.io/t/getting-error-your-php-installation-appears-to-be-missing-the-mysql-extension-which-is-required-by-wordpress/23529
**Category:** trellis
**Created:** 2022-07-09T23:51:05Z
**Posts:** 3

## Post 1 by @chinaski — 2022-07-09T23:51:05Z

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](https://discourse.roots.io/t/macos-monterey-update-cant-vagrant-up-anymore-mount-nfs-connection-timed-out/21924/4)

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
```

---

## Post 2 by @strarsis — 2022-07-10T01:09:15Z

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

> <https://github.com/roots/trellis/blob/b3529c5dbbfc15a23b9cd0112754cb08df054b4c/roles/php/tasks/main.yml#L7>

---

## Post 3 by @chinaski — 2022-07-11T14:30:47Z

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](https://github.com/roots/trellis/commit/5f398b2e27f1838b2eb4998a961c43db81c7aa57)

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