Zoneminder; ZM db.could not find driver; Ubuntu 18.04

I am running Ubuntu 18.04 and trying to run zoneminder. The status is active when I run systemctl status zoneminder.

So it is installed. When I browse to the server at http://linux-box_IP/zm/ I get the below error.

Unable to connect to ZM db.could not find driver

I followed two different walkthroughs and achieved the same results (including the automatic install script):

https://wiki.zoneminder.com/Ubuntu_Server_18.04_64-bit_with_Zoneminder_1.32.x_the_easy_way

https://bkjaya.wordpress.com/2018/05/22/how-to-install-zoneminder-v1-31-44-on-ubuntu-18-04-lts/

Has anyone seen this or have any ideas?

** UPDATE

I used the automatic install script from the wiki again on a clean install of ubuntu and it worked the first time no problem. Not sure what was causing the problem because the system I tried it on initially was far from a clean environment.


I had the same problem and figured it out. This may help you.

In my case I initially had Ubuntu 14.04 LTS, which was upgraded to Ubuntu 16.04 LTS and finally to Ubuntu 18.04 LTS. Thus I had several conflicting configurations of apache2-mod-php.

# ls -la /etc/apache2/mods-available/php*
-rw-r--r-- 1 root root 897 Jul  2  2015 /etc/apache2/mods-available/php5.conf
-rw-r--r-- 1 root root  59 Jul  2  2015 /etc/apache2/mods-available/php5.load
-rw-r--r-- 1 root root 867 Mar 22 19:16 /etc/apache2/mods-available/php7.0.conf
-rw-r--r-- 1 root root  79 Mar 22 19:16 /etc/apache2/mods-available/php7.0.load
-rw-r--r-- 1 root root 855 Apr 18 17:12 /etc/apache2/mods-available/php7.2.conf
-rw-r--r-- 1 root root 102 Apr 18 17:12 /etc/apache2/mods-available/php7.2.load

And php7.0 was enabled along with php7.2 which caused the problem.

# ls -la /etc/apache2/mods-enabled/php*
lrwxrwxrwx 1 root root 29 Apr  7 20:25 /etc/apache2/mods-enabled/php7.0.conf -> ../mods-available/php7.0.conf
lrwxrwxrwx 1 root root 29 Apr  7 20:25 /etc/apache2/mods-enabled/php7.0.load -> ../mods-available/php7.0.load
lrwxrwxrwx 1 root root 29 May  3 00:22 /etc/apache2/mods-enabled/php7.2.conf -> ../mods-available/php7.2.conf
lrwxrwxrwx 1 root root 29 May  3 00:22 /etc/apache2/mods-enabled/php7.2.load -> ../mods-available/php7.2.load

Disable them, make sure that all libraries are installed and restart apache:

sudo a2dismod php7.0
sudo a2dismod php5    
sudo apt install php7.2 libapache2-mod-php7.2 php7.2-mysql php-common php7.2-cli php7.2-common php7.2-json php7.2-opcache php7.2-readline
sudo a2enmod php7.2
sudo systemctl restart apache2

At this point ZoneMinder should be OK. Hope this helps!