@davvidde to answer your specific original question:
pkg upgrade php74-pfSense-module
However, I was in the same situation you were. This is on a Netgate 3100 on which 22.01 was installed from USB image, then an upgrade was attempted from the GUI to 22.05 on 2022-01-04. Standard old-fashioned install, not a ZFS boot environment.
The upgrade appeared to complete but upon reboot/login a "programming error" was reported, same as yours.
Thanks to @Gertjan 's advice on this this thread, I found the extant state to be:
[22.05-RELEASE][admin@pfsense]/root: ls -altr /usr/local/lib/php/20190902/
total 3456
-rw-r--r-- 1 root wheel 50164 Jan 12 2022 simplexml.so
-rw-r--r-- 1 root wheel 37144 Jan 12 2022 filter.so
-rw-r--r-- 1 root wheel 26772 Jan 12 2022 pcntl.so
-rw-r--r-- 1 root wheel 9924 Jan 12 2022 sysvshm.so
-rw-r--r-- 1 root wheel 79736 Jan 12 2022 session.so
-rw-r--r-- 1 root wheel 7740 Jan 12 2022 sysvsem.so
-rw-r--r-- 1 root wheel 41884 Jan 12 2022 sqlite3.so
-rw-r--r-- 1 root wheel 25112 Jan 12 2022 xmlreader.so
-rw-r--r-- 1 root wheel 34848 Jan 12 2022 xmlwriter.so
-rw-r--r-- 1 root wheel 9408 Jan 12 2022 ctype.so
-rw-r--r-- 1 root wheel 502668 Jan 12 2022 opcache.so
-rw-r--r-- 1 root wheel 100124 Jan 12 2022 pfSense.so
-rw-r--r-- 1 root wheel 39176 Jan 12 2022 json.so
-rw-r--r-- 1 root wheel 73404 Jan 12 2022 ldap.so
-rw-r--r-- 1 root wheel 12008 Jan 12 2022 sysvmsg.so
-rw-r--r-- 1 root wheel 78296 Jan 12 2022 sockets.so
-rw-r--r-- 1 root wheel 25168 Jan 12 2022 readline.so
-rw-r--r-- 1 root wheel 22712 Jan 12 2022 pdo_sqlite.so
-rw-r--r-- 1 root wheel 10324 Jan 12 2022 gettext.so
-rw-r--r-- 1 root wheel 17080 Jan 12 2022 bz2.so
-rw-r--r-- 1 root wheel 383852 Jan 12 2022 intl.so
-rw-r--r-- 1 root wheel 8760 Jan 12 2022 shmop.so
-rw-r--r-- 1 root wheel 25104 Jan 12 2022 posix.so
drwxr-xr-x 4 root wheel 512 Feb 7 2022 ..
-rw-r--r-- 1 root wheel 41392 Jun 1 2022 xml.so
-rw-r--r-- 1 root wheel 37772 Jun 1 2022 zlib.so
-rw-r--r-- 1 root wheel 34052 Jun 1 2022 mcrypt.so
-rw-r--r-- 1 root wheel 16508 Jun 1 2022 tokenizer.so
-rw-r--r-- 1 root wheel 158024 Jun 1 2022 dom.so
-rw-r--r-- 1 root wheel 159584 Jun 1 2022 openssl.so
-rw-r--r-- 1 root wheel 1004320 Jun 1 2022 mbstring.so
-rw-r--r-- 1 root wheel 91544 Jun 1 2022 pdo.so
-rw-r--r-- 1 root wheel 42736 Jun 1 2022 radius.so
-rw-r--r-- 1 root wheel 30140 Jun 1 2022 bcmath.so
-rw-r--r-- 1 root wheel 88780 Jun 1 2022 curl.so
-rw-r--r-- 1 root wheel 26052 Jun 1 2022 rrd.so
drwxr-xr-x 2 root wheel 1024 Jan 4 07:45 .
So some of the .so's were upgraded and some not. Looking further:
[22.05-RELEASE][admin@pfsense]/root: pkg which /usr/local/lib/php/20190902/pfSense.so
/usr/local/lib/php/20190902/pfSense.so was installed by package php74-pfSense-module-0.76
[22.05-RELEASE][admin@pfsense]/root: pkg search pfSense-module
php74-pfSense-module-0.81 Library for getting useful info
[22.05-RELEASE][admin@pfsense]/root: pkg upgrade php74-pfSense-module
Updating pfSense-core repository catalogue...
pfSense-core repository is up to date.
Updating pfSense repository catalogue...
pfSense repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):
Installed packages to be UPGRADED:
php74-pfSense-module: 0.76 -> 0.81 [pfSense]
Number of packages to be upgraded: 1
Proceed with this action? [y/N]: y
[1/1] Upgrading php74-pfSense-module from 0.76 to 0.81...
[1/1] Extracting php74-pfSense-module-0.81: 100%
[22.05-RELEASE][admin@pfsense]/root: ls -altr /usr/local/lib/php/20190902/
total 3460
-rw-r--r-- 1 root wheel 50164 Jan 12 2022 simplexml.so
-rw-r--r-- 1 root wheel 37144 Jan 12 2022 filter.so
-rw-r--r-- 1 root wheel 26772 Jan 12 2022 pcntl.so
-rw-r--r-- 1 root wheel 9924 Jan 12 2022 sysvshm.so
-rw-r--r-- 1 root wheel 79736 Jan 12 2022 session.so
-rw-r--r-- 1 root wheel 7740 Jan 12 2022 sysvsem.so
-rw-r--r-- 1 root wheel 41884 Jan 12 2022 sqlite3.so
-rw-r--r-- 1 root wheel 25112 Jan 12 2022 xmlreader.so
-rw-r--r-- 1 root wheel 34848 Jan 12 2022 xmlwriter.so
-rw-r--r-- 1 root wheel 9408 Jan 12 2022 ctype.so
-rw-r--r-- 1 root wheel 502668 Jan 12 2022 opcache.so
-rw-r--r-- 1 root wheel 39176 Jan 12 2022 json.so
-rw-r--r-- 1 root wheel 73404 Jan 12 2022 ldap.so
-rw-r--r-- 1 root wheel 12008 Jan 12 2022 sysvmsg.so
-rw-r--r-- 1 root wheel 78296 Jan 12 2022 sockets.so
-rw-r--r-- 1 root wheel 25168 Jan 12 2022 readline.so
-rw-r--r-- 1 root wheel 22712 Jan 12 2022 pdo_sqlite.so
-rw-r--r-- 1 root wheel 10324 Jan 12 2022 gettext.so
-rw-r--r-- 1 root wheel 17080 Jan 12 2022 bz2.so
-rw-r--r-- 1 root wheel 383852 Jan 12 2022 intl.so
-rw-r--r-- 1 root wheel 8760 Jan 12 2022 shmop.so
-rw-r--r-- 1 root wheel 25104 Jan 12 2022 posix.so
drwxr-xr-x 4 root wheel 512 Feb 7 2022 ..
-rw-r--r-- 1 root wheel 41392 Jun 1 2022 xml.so
-rw-r--r-- 1 root wheel 37772 Jun 1 2022 zlib.so
-rw-r--r-- 1 root wheel 34052 Jun 1 2022 mcrypt.so
-rw-r--r-- 1 root wheel 16508 Jun 1 2022 tokenizer.so
-rw-r--r-- 1 root wheel 158024 Jun 1 2022 dom.so
-rw-r--r-- 1 root wheel 159584 Jun 1 2022 openssl.so
-rw-r--r-- 1 root wheel 1004320 Jun 1 2022 mbstring.so
-rw-r--r-- 1 root wheel 91544 Jun 1 2022 pdo.so
-rw-r--r-- 1 root wheel 42736 Jun 1 2022 radius.so
-rw-r--r-- 1 root wheel 30140 Jun 1 2022 bcmath.so
-rw-r--r-- 1 root wheel 88780 Jun 1 2022 curl.so
-rw-r--r-- 1 root wheel 26052 Jun 1 2022 rrd.so
-rw-r--r-- 1 root wheel 102804 Jun 1 2022 pfSense.so
drwxr-xr-x 2 root wheel 1024 Jan 5 14:44 .
So that fixed the specific module. Looking further:
[22.05-RELEASE][admin@pfsense]/root: pkg which /usr/local/lib/php/20190902/json.so
/usr/local/lib/php/20190902/json.so was installed by package php74-json-7.4.26
[22.05-RELEASE][admin@pfsense]/root: pkg search php74-json
php74-json-7.4.28 The json shared extension for php
So I figured that several packages were not upgraded on the system upgrade.
Going for broke:
[22.05-RELEASE][admin@pfsense]/root: pkg upgrade
Updating pfSense-core repository catalogue...
pfSense-core repository is up to date.
Updating pfSense repository catalogue...
pfSense repository is up to date.
All repositories are up to date.
Checking for upgrades (46 candidates): 100%
Processing candidates (46 candidates): 100%
Checking integrity... done (0 conflicting)
The following 47 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
php74-libbe: 0.1.4 [pfSense]
Installed packages to be UPGRADED:
arpwatch: 3.1 -> 3.2 [pfSense]
bash: 5.1.12 -> 5.1.16 [pfSense]
bind-tools: 9.16.23 -> 9.16.26 [pfSense]
clamav: 0.104.1,1 -> 0.104.2,1 [pfSense]
db5: 5.3.28_7 -> 5.3.28_8 [pfSense]
dnsmasq: 2.86,1 -> 2.86_3,1 [pfSense]
dpinger: 3.0 -> 3.2 [pfSense]
filterdns: 2.0_5 -> 2.0_6 [pfSense]
hostapd: 2.9_4 -> 2.10 [pfSense]
iperf3: 3.10.1_1 -> 3.11 [pfSense]
links: 2.20.2_1,1 -> 2.25,1 [pfSense]
mpd5: 5.9_6 -> 5.9_7 [pfSense]
mtr-nox11: 0.94_1 -> 0.95 [pfSense]
nginx: 1.20.2_1,2 -> 1.20.2_9,2 [pfSense]
nss: 3.73 -> 3.76 [pfSense]
ntp: 4.2.8p15_3 -> 4.2.8p15_5 [pfSense]
openvpn: 2.5.4_1 -> 2.6.0_8 [pfSense]
pfSense: 22.01 -> 22.05 [pfSense]
pfSense-u-boot-env: 20211006 -> 20220429 [pfSense]
php74-bz2: 7.4.26 -> 7.4.28 [pfSense]
php74-ctype: 7.4.26 -> 7.4.28 [pfSense]
php74-filter: 7.4.26 -> 7.4.28 [pfSense]
php74-gettext: 7.4.26 -> 7.4.28 [pfSense]
php74-intl: 7.4.26 -> 7.4.28 [pfSense]
php74-json: 7.4.26 -> 7.4.28 [pfSense]
php74-ldap: 7.4.26 -> 7.4.28 [pfSense]
php74-opcache: 7.4.26 -> 7.4.28 [pfSense]
php74-pcntl: 7.4.26 -> 7.4.28 [pfSense]
php74-pdo_sqlite: 7.4.26 -> 7.4.28 [pfSense]
php74-posix: 7.4.26 -> 7.4.28 [pfSense]
php74-readline: 7.4.26 -> 7.4.28 [pfSense]
php74-session: 7.4.26 -> 7.4.28 [pfSense]
php74-shmop: 7.4.26 -> 7.4.28 [pfSense]
php74-simplexml: 7.4.26 -> 7.4.28 [pfSense]
php74-sockets: 7.4.26 -> 7.4.28 [pfSense]
php74-sqlite3: 7.4.26 -> 7.4.28 [pfSense]
php74-sysvmsg: 7.4.26 -> 7.4.28 [pfSense]
php74-sysvsem: 7.4.26 -> 7.4.28 [pfSense]
php74-sysvshm: 7.4.26 -> 7.4.28 [pfSense]
php74-xmlreader: 7.4.26 -> 7.4.28 [pfSense]
php74-xmlwriter: 7.4.26 -> 7.4.28 [pfSense]
py38-libzfs: 1.1.2021100100 -> 1.1.2022021400 [pfSense]
smartmontools: 7.2_3 -> 7.3 [pfSense]
squid: 4.15 -> 5.4.1 [pfSense]
suricata: 6.0.4 -> 6.0.4_3 [pfSense]
zeek: 4.0.4 -> 4.0.5 [pfSense]
Number of packages to be installed: 1
Number of packages to be upgraded: 46
The process will require 5 MiB more space.
Proceed with this action? [y/N]: y
...
That ran OK, upon which:
[22.05-RELEASE][admin@pfsense]/root: ls -altr /usr/local/lib/php/20190902/
total 3500
drwxr-xr-x 4 root wheel 512 Feb 7 2022 ..
-rw-r--r-- 1 root wheel 41392 Jun 1 2022 xml.so
-rw-r--r-- 1 root wheel 37772 Jun 1 2022 zlib.so
-rw-r--r-- 1 root wheel 34052 Jun 1 2022 mcrypt.so
-rw-r--r-- 1 root wheel 16508 Jun 1 2022 tokenizer.so
-rw-r--r-- 1 root wheel 158024 Jun 1 2022 dom.so
-rw-r--r-- 1 root wheel 48780 Jun 1 2022 simplexml.so
-rw-r--r-- 1 root wheel 159584 Jun 1 2022 openssl.so
-rw-r--r-- 1 root wheel 1004320 Jun 1 2022 mbstring.so
-rw-r--r-- 1 root wheel 91544 Jun 1 2022 pdo.so
-rw-r--r-- 1 root wheel 37288 Jun 1 2022 filter.so
-rw-r--r-- 1 root wheel 42736 Jun 1 2022 radius.so
-rw-r--r-- 1 root wheel 30140 Jun 1 2022 bcmath.so
-rw-r--r-- 1 root wheel 27268 Jun 1 2022 pcntl.so
-rw-r--r-- 1 root wheel 10004 Jun 1 2022 sysvshm.so
-rw-r--r-- 1 root wheel 78348 Jun 1 2022 session.so
-rw-r--r-- 1 root wheel 7724 Jun 1 2022 sysvsem.so
-rw-r--r-- 1 root wheel 42076 Jun 1 2022 sqlite3.so
-rw-r--r-- 1 root wheel 25464 Jun 1 2022 xmlreader.so
-rw-r--r-- 1 root wheel 34688 Jun 1 2022 xmlwriter.so
-rw-r--r-- 1 root wheel 9532 Jun 1 2022 ctype.so
-rw-r--r-- 1 root wheel 498832 Jun 1 2022 opcache.so
-rw-r--r-- 1 root wheel 74556 Jun 1 2022 ldap.so
-rw-r--r-- 1 root wheel 12200 Jun 1 2022 sysvmsg.so
-rw-r--r-- 1 root wheel 25328 Jun 1 2022 readline.so
-rw-r--r-- 1 root wheel 78344 Jun 1 2022 sockets.so
-rw-r--r-- 1 root wheel 23188 Jun 1 2022 pdo_sqlite.so
-rw-r--r-- 1 root wheel 10388 Jun 1 2022 gettext.so
-rw-r--r-- 1 root wheel 17416 Jun 1 2022 bz2.so
-rw-r--r-- 1 root wheel 8808 Jun 1 2022 shmop.so
-rw-r--r-- 1 root wheel 26512 Jun 1 2022 posix.so
-rw-r--r-- 1 root wheel 88780 Jun 1 2022 curl.so
-rw-r--r-- 1 root wheel 26052 Jun 1 2022 rrd.so
-rw-r--r-- 1 root wheel 33428 Jun 1 2022 libbe.so
-rw-r--r-- 1 root wheel 102804 Jun 1 2022 pfSense.so
-rw-r--r-- 1 root wheel 38456 Jun 1 2022 json.so
-rw-r--r-- 1 root wheel 385828 Jun 1 2022 intl.so
drwxr-xr-x 2 root wheel 1024 Jan 5 14:47 .
A reboot was successful with no error upon login.
n.b. @jimp , it appears this thread was accurately in the Installation and Upgrades category originally, if that matters (the captive portal error message appears to be incidental to a failed php74-pfSense-module upgrade). No captive portals are in use on this device.
It would be useful if the upgrade procedure verified successful state transition before or after its reboot.