I got my local installation of WebWork running again.
Basically I had the same issue asĀ
https://webwork.maa.org/moodle/mod/forum/discuss.php?d=4246
There are a couple perl module missing and I need to do
a2enmod perl and a2enmod apreq2
reinstall libmariabd-dev from Ubuntu and use cpan to install DBD::MariaDB
sudo cpanm DBD::MariaDB
Hope this will help others who finds themselves in a similar situation.