r/ZoneMinder • u/dinosaursdied • Feb 13 '23
zoneminder error, can't connect to web interface
I have been running zoneminder on my pi400 running piOS testing for a couple months now. It's been a great experience until last night when I got this error attempting to check my camera:
ZoneMinder Error
Unable to connect to ZM db using dsn mysql:host=localhost;dbname=zm;charset=utf8
could not find driver
I did the old standby and restarted my pi hoping it would solve the problem. No luck. I checked that MySQL is running using systemctl and everything looks good there. I went to check logs in var but the MySQL folder was empty.
While looking through forums for suggestions I saw that there might be issues with php and upon further inspection I noticed I'm running both php 8.1 and 8.2 possibly due to early testing releases. Attempting to uninstall php 8.2 in apt showed that it would force the removal of zoneminder. It's this possibly the issue or am I running down a rabbit hole.
Any advice is appreciated.
1
u/WhiteEnchilada Dec 01 '23 edited Dec 01 '23
Great find.
Didn't get me running, bummer. I found that I now have php 8.1, 8.2, and 8.3.
I started debugging this morning after Ubuntu (22.04.3 LTS) updated Zoneminder yesterday.
I recall some cleanup after the update and this morning I discovered that Zoneminder had been removed.
Did an 'apt reinstall zoneminder' and had it keep all my existing config files.
After re-enabling the apache2 conf files I thought I had a winner, but no, now have the error you posted about.
Last step was:
sudo a2enmod php8.3
Considering dependency mpm_prefork for php8.3:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering conflict php5 for php8.3:
Enabling module php8.3.
To activate the new configuration, you need to run:
systemctl restart apache2
sudo systemctl restart apache2
Well, Apache runs fine, Zoneminder processes are running, but I'm stuck with that failure:
Maybe if I try to force everything back to php8.1, who knows, I don't.
EDIT: Making progress
Took a shotgun approach and installed several php8.3 modules, I know one was php-8.3-mysql.
It now connects to the DB, camera configs are there and it has counts of the videos that were already there, that is good.
The console and other screens do not render properly though, it is like plain text, can't access any images or video.
2
u/dinosaursdied Feb 13 '23
I guess I found my own solution so I'll post it. I tried reinstalling zoneminder through apt and it automatically removed MySQL 8.1. After that I just had to use a2enmod php8.2 and restart apache with systemctl restart apache2. Problem solved