[HELP]: Multiple ZM installs using a single, remote database

Support and queries relating to all previous versions of ZoneMinder
Locked
anupmankar
Posts: 13
Joined: Mon Feb 02, 2009 2:46 pm
Location: Bangalore, India

[HELP]: Multiple ZM installs using a single, remote database

Post by anupmankar »

Hi guys,

First a big thank you to the maker of ZM for creating such an elegant surveillance solution and that too open source :)

I am trying to deploy ZM on two separate machines but only one of them has MySQL server running. I want the other (database-less) machine to access the same ZM database on the remote machine. So I ran the ./configure script as follows:

./configure --with-webdir=xxx --with-cgidir=xxx ZM_DB_HOST="172.16.0.224" ZM_DB_NAME="zm" ZM_DB_USER="zmuser" ZM_DB_PASS="zmpass" ZM_SSL_LIB=openssl --with-webuser=www-data --with-webgroup=www-data

The installation completes. But when I point the browser to "http://localhost/zm/index.php" (the alias has been set) I get an error which reads:

Fatal error: Call to undefined function mysql_pconnect() in /usr/share/zoneminder/zm_db.php on line 27

Can anyone help me out here?

Thanks in advance.

EDIT: The default_host in php.ini [mysql] section has also been set to 172.16.0.224.
splatty
Posts: 7
Joined: Sun Feb 01, 2009 5:51 pm
Location: London, UK

Shouldn't be too much of a pain BUT.

Post by splatty »

THE FOLLOWING MUST BE TAKEN WITH A PINCH OF SALT.

BECAUSE: i am new to zoneminder myself. only been using for a few days, and am a serious newbie!

However, I can make the followig observations:

1) If your running two instances of zoneminder and one database, you need to make sure that things like camera IDs are different. I don't yet know how zoneminder creates the data in mysql, but, it's fair to assume its probably by camera id ( i don't mean name). If this is the case, and you use the same camera ids on both instances of zoneminder writing to the database, this could potentially be a problem.

I could also be talking out my rear end.

2) Consider why you actually want to do this. Why not just run a database on each zoneminder machine. Is it because you would just like to be able to see all events across both machines ? If it is, im not sure how you would do that anyway, not through one interface anyway.

All the i'm saying is that i'm not really sure why you want to do this... albeit, it has some logic i can see - but only in certain circumstances.

I know that ZM4MS (the windows client for Zoneminder) has an interface to connect and retreive images from the zm remote machine. However, from what I can see, despite the fact that you can view cams from many machines, you wont be able to play back from multiple ZM machines. Also take note that when I played with ZM4MS, i couldnt playback anything, even though it saw all events and everything - and it LOOKS like but not sure that it because i am using the deep file storage structure. I assume this as it appears to be a new feature - and ZM4MS is not newer than 1.23 - however once again, i could be talking out my rear. As i said i'm a newbie with no experience with ZM whatsoever.
Im a weirdo. No seriously, I am.

Tomorrow is a new day. Does that mean yesterday was an old one, or just the day before today?
Paranoid
Posts: 129
Joined: Thu Feb 05, 2009 10:40 pm

Post by Paranoid »

Its only a guess, but you probably need to install php5-sqlite.

[EDIT} Ignore that, I'm talking rubbish.

Have you configured apache/php to use mysql? Somewhere within your configs you need to have the following:

extension=mysql.so

You will also need to have installed the php5-mysql package
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Paranoid wrote:You will also need to have installed the php5-mysql package
This is all you need.
anupmankar
Posts: 13
Joined: Mon Feb 02, 2009 2:46 pm
Location: Bangalore, India

Post by anupmankar »

thanks guys ... that one worked :)
Locked