1

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.

2 Answers2

3

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!

DarkSidds
  • 31
  • 3
0

In case it helps anyone. I'm running Linux Mint 18.x (Linux 4.15.0-48-generic #51~16.04.1-Ubuntu8 6_64 GNU/Linux) and had this problem with Apache 2.1.18, PHP 7.0 and ZoneMinder v1.33.8 after upgrading from 1.29.

$> php -i | grep mysql gave the following output:

PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/pdo_mysql.so' - /usr/lib/php/20151012/pdo_mysql.so: undefined symbol: mysqlnd_connect in Unknown on line 0

On investigation, I found the following:

  1. The following .ini files had been installed under /usr/share/php7.0-mysql/mysql, but were not found in /etc/php/7.0/mods-available

    • mysqlnd.ini
    • pdo_mysql.ini
    • mysqli.ini
  2. Symbolic links these .ini files existed under /etc/php/7.0/fpm/conf.d/, /etc/php/7.0/cli/conf.d and /etc/php/7.0/apache2/conf.d pointing to /etc/php/7.0/mods-available.

Solution:

  1. Copy the .ini files from /usr/share/php7.0-mysql/mysql into /etc/php/7.0/mods-available

  2. Restart Apache2:

    systemctl restart apache2
    

Following that I was able to start ZoneMinder quite happily and php -i/php -m worked without complaint.

sotirov
  • 4,379