JsonSerializable error when manually updating to v22.0

Hello, Iā€™m trying manually update Nextcloud to v22.0 but Iā€™m getting errors. I have PHP 7.4 installed and this is the unzipped file that I downloaded from the website:
image

When I run the command su -m www -c php occ upgrade I get the following error:
image

Doing some research, it seems to be something about php? Iā€™m not sure about this one though. The file in question is the following:
image

This is my first time doing a manual update because when I tried doing the update using the web interface, it hang in a loop that said ā€œupdate in processā€. Whatā€™s wrong here? Anyone familiar with the error?

There is a permission error (cannot write inā€¦). You are executing the update and also the code is run as the user www!
Now look at your files:
image

the user www is not allowed to open the folders (needs the execution flag (x).

You hopefully have your original config.php in the config/ folder?

You can just change the ownership recursively:
chown -R www:www /usr/www/nextcloud/.

Thank you for the help!

I do, I copied the original config.php to the unzipped folder. Let me try changing the ownership, Iā€™m frustrated since it has been a few days already.

I updated permissions to all the files and when running the command su -m www -c 'php occ upgrade' I get a nasty error:
image

Searching the forums, I found a couple posts but not really related to my problem. I donā€™t understand why PDO wouldnā€™t be in Connection.php? My php version is 7.4 currently.

pkg search pdo

and then you should find and install php74-pdo_mysql-7.4.24

image

My FreeBSD version:
image

My jails are also 12.0-RELEASE.

Could this be the issue? I found that the pkg is 12.2 but the kernel is 12.0!
image

seems you canā€™t easily use pkg for outdated FreeBSD versions:
https://forums.freebsd.org/threads/pkg-repository-freebsd-contains-packages-for-wrong-os-version-freebsd-12-amd64.78856/

but you could upgrade to FreeBSD 12.2:
https://www.freebsd.org/releases/12.2R/installation/

Interestingly enough, I am on 12.2 version currently:
image

But if I run the command inside a jail, they are on 12.0-RELEASE-p13 so I donā€™t understand the issue.

I think at this point, you have to check with the FreeBSD community. They have some documentation about how to update jails: https://docs.freebsd.org/en/books/handbook/jails/#jails-tuning