Easy Way: Upgrading from non API package to API package - 3esmit/zmNinja GitHub Wiki
If you already have a package installed which does not support APIS (1.28.1/2 and below), then follow these instructions:
Note: We assume ZM is working well in your existing package
sudo systemctl stop zoneminder.service
Step 1: Switch to master branch of iconnor's PPAs (that is where the APIs are)
sudo add-apt-repository -r ppa:iconnor/zoneminder
sudo add-apt-repository ppa:iconnor/zoneminder-master
sudo apt-get update
Step 2: Upgrade your ZoneMinder
sudo apt-get install zoneminder
Step 3: Grant correct permissions (as new versions need this, while old versions did not)
mysql -uroot -p -e "grant select,insert,update,delete,create,alter,index,lock tables on zm.* to 'zmuser'@localhost identified by 'zmpass';"
Step 4: Upgrade your DB
sudo zmupdate.pl
Step 5: Configure Apache
sudo rm /etc/apache2/conf-enabled/zoneminder.conf
sudo a2enmod rewrite
sudo a2enmod cgi
sudo a2enconf zoneminder
Step 6: Fix permissions
sudo chown -R www-data:www-data /usr/share/zoneminder/
We also need to install php5-gd (as of 1.28.107, this is not installed)
sudo apt-get install php5-gd
Step 7: Edit Timezone in PHP
vi /etc/php5/apache2/php.ini Look for [Date] and inside it you will see a date.timezone that is commented. remove the comment and specific your timezone. Please make sure the timezone is valid (see this)
In my case:
date.timezone = America/New_York
Step 8: Restart services
sudo service apache2 reload
sudo systemctl start zoneminder
Step 9: Correct your cgi-bin path
New versions of the ubuntu package after 1.28 use a different CGI path. Load up your ZM web console in a browser
Make sure
Options->Path->PATH_ZMS is set to /zm/cgi-bin/nph-zms
Step 10: Restart and make sure its working
sudo systemctl restart zoneminder