Half-broken upgrade to 13 from 12

I’m getting the (in)famous

[FATAL] DB Error: extension not found

However, asterisk is running. I can even view its status from the FreePBX console. I can connect to the database (mariadb) using the credentials I supply to FreePBX (obviously, since I can access the console). php5; apache modules are:

core mod_so mod_watchdog http_core mod_log_config mod_logio mod_version mod_unixd mod_access_compat mod_alias mod_auth_basic mod_authn_core mod_authn_file mod_authz_core mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_deflate mod_dir mod_env mod_filter mod_mime prefork mod_negotiation mod_php5 mod_reqtimeout mod_rewrite mod_setenvif mod_status

amportal is giving the equally-infamous

astrundir in ‘/etc/asterisk’ is set to but the directory
does not exists. Attempting to create it with: 'mkdir -p ’

fwconsole isn’t installed yet, because trying to execute install from the latest source gives me the DB Error again.

I’d be happy to live with 12.0.76.4 again, but with this half-broken situation, I can’t “Apply Config” on anything, meaning I can’t provision changes in my system (except by manual changes to files in /etc/asterisk, which kind of defeats the point).

Moral of story: If it ain’t broke, don’t try to fix it.

Any tips on where I start looking - much appreciated.

Update - it appears there was a php7 parallel installation which I’d overlooked because it wasn’t enabled in apache. Strace put me on the right track to discover this. Still having some problems, but this is a different kettle of fish now.