{"id":3321,"date":"2018-08-10T21:29:49","date_gmt":"2018-08-11T02:29:49","guid":{"rendered":"http:\/\/lisa.rushworth.us\/?p=3321"},"modified":"2018-08-16T14:49:16","modified_gmt":"2018-08-16T19:49:16","slug":"zoneminder-and-php-7-2","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=3321","title":{"rendered":"Zoneminder and PHP 7.2"},"content":{"rendered":"<p>After updating to php 7.2, ZoneMinder completely stopped working. Fortunately there were <em>lots<\/em> of entries in the error_log file<\/p>\n<pre>[Fri Aug 10 15:44:19.880809 2018] [php7:error] [pid 5293] [client 127.0.0.1:46958] PHP Fatal error:  Cannot use 'Object' as class name as it is reserved in \/usr\/share\/zoneminder\/www        \/api\/lib\/Cake\/Core\/Object.php on line 30\r\n[Fri Aug 10 15:44:19.889737 2018] [php7:warn] [pid 5293] [client 127.0.0.1:46958] PHP Warning:  file_put_contents(\/var\/lib\/zoneminder\/templogs\/cake_error.log) [<a href=\"http:\/\/php.n et\/function.file-put-contents\">function.file-put-contents<\/a>]: failed to open stream: No such file or directory in \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Log\/Engine\/FileLog.php on         line 142\r\n[Fri Aug 10 15:44:19.889850 2018] [php7:warn] [pid 5293] [client 127.0.0.1:46958] PHP Warning:  file_put_contents(\/var\/log\/zonemindererror.log) [<a href=\"http:\/\/php.net\/function.fil e-put-contents\">function.file-put-contents<\/a>]: failed to open stream: Permission denied in \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Log\/Engine\/FileLog.php on line 142\r\n[Fri Aug 10 15:44:19.890176 2018] [php7:warn] [pid 5293] [client 127.0.0.1:46958] PHP Warning:  file_put_contents(\/var\/lib\/zoneminder\/templogs\/cake_error.log) [<a href=\"http:\/\/php.n et\/function.file-put-contents\">function.file-put-contents<\/a>]: failed to open stream: No such file or directory in \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Log\/Engine\/FileLog.php on         line 142\r\n[Fri Aug 10 15:44:19.890221 2018] [php7:warn] [pid 5293] [client 127.0.0.1:46958] PHP Warning:  file_put_contents(\/var\/log\/zonemindererror.log) [<a href=\"http:\/\/php.net\/function.fil e-put-contents\">function.file-put-contents<\/a>]: failed to open stream: Permission denied in \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Log\/Engine\/FileLog.php on line 142\r\n[Fri Aug 10 15:44:19.890594 2018] [php7:warn] [pid 5293] [client 127.0.0.1:46958] PHP Warning:  file_put_contents(\/var\/lib\/zoneminder\/templogs\/cake_error.log) [<a href=\"http:\/\/php.n et\/function.file-put-contents\">function.file-put-contents<\/a>]: failed to open stream: No such file or directory in \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Log\/Engine\/FileLog.php on         line 142\r\n[Fri Aug 10 15:44:19.890637 2018] [php7:warn] [pid 5293] [client 127.0.0.1:46958] PHP Warning:  file_put_contents(\/var\/log\/zonemindererror.log) [<a href=\"http:\/\/php.net\/function.fil e-put-contents\">function.file-put-contents<\/a>]: failed to open stream: Permission denied in \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Log\/Engine\/FileLog.php on line 142\r\n[Fri Aug 10 15:44:19.890960 2018] [php7:warn] [pid 5293] [client 127.0.0.1:46958] PHP Warning:  file_put_contents(\/var\/lib\/zoneminder\/templogs\/cake_error.log) [<a href=\"http:\/\/php.n et\/function.file-put-contents\">function.file-put-contents<\/a>]: failed to open stream: No such file or directory in \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Log\/Engine\/FileLog.php on         line 142\r\n[Fri Aug 10 15:44:19.891021 2018] [php7:warn] [pid 5293] [client 127.0.0.1:46958] PHP Warning:  file_put_contents(\/var\/log\/zonemindererror.log) [<a href=\"http:\/\/php.net\/function.fil e-put-contents\">function.file-put-contents<\/a>]: failed to open stream: Permission denied in \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Log\/Engine\/FileLog.php on line 142\r\n[Fri Aug 10 15:44:19.892818 2018] [php7:error] [pid 5293] [client 127.0.0.1:46958] PHP Fatal error:  Uncaught Error: Class 'Controller' not found in \/usr\/share\/zoneminder\/www\/api\/li        b\/Cake\/Error\/ExceptionRenderer.php:174\\nStack trace:\\n#0 \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Error\/ExceptionRenderer.php(92): ExceptionRenderer-&gt;_getController(Object(InternalErr        orException))\\n#1 \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Error\/ErrorHandler.php(126): ExceptionRenderer-&gt;__construct(Object(InternalErrorException))\\n#2 \/usr\/share\/zoneminder\/www\/ap        i\/lib\/Cake\/Error\/ErrorHandler.php(284): ErrorHandler::handleException(Object(InternalErrorException))\\n#3 \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Error\/ErrorHandler.php(213): ErrorHa        ndler::handleFatalError(64, 'Cannot use 'Obj...', '\/usr\/share\/zone...', 30)\\n#4 \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Core\/App.php(970): ErrorHandler::handleError(64, 'Cannot use '        Obj...', '\/usr\/share\/zone...', 30, Array)\\n#5 \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Core\/App.php(943): App::_checkFatalError()\\n#6 [internal function]: App::shutdown()\\n#7 {main}\\n          thrown in \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Error\/ExceptionRenderer.php on line 174<\/pre>\n<p>Looks like CakePHP used <a href=\"https:\/\/github.com\/ZoneMinder\/zoneminder\/issues\/1227\" target=\"_blank\" rel=\"noopener\">class names that are now reserved words<\/a>. Unfortunately, you cannot just drop the updated CakePHP files into ZoneMinder (I tried). Until the repository package is updated, you&#8217;ve got to build ZoneMinder <a href=\"https:\/\/github.com\/ZoneMinder\/zoneminder\" target=\"_blank\" rel=\"noopener\">from source<\/a>. Or grab the testing RPM from the <a href=\"https:\/\/zmrepo.zoneminder.com\" target=\"_blank\" rel=\"noopener\">zoneminder.com repo<\/a>.\u00a01.31.45-1.13 works. Don&#8217;t forget to run &#8220;perl \/usr\/bin\/zmupdate.pl&#8221; to update the database.<\/p>\n<p>Then I had to throw the database connection into from the config file into \/usr\/share\/zoneminder\/www\/api\/app\/Config\/database.php (default array) because I do not use the default connection info.<\/p>\n<p>Once I had the updated ZoneMinder along with the newer CakePHP that the ZM folks have in their repo &#8230; we&#8217;ve got ZoneMinder again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After updating to php 7.2, ZoneMinder completely stopped working. Fortunately there were lots of entries in the error_log file [Fri Aug 10 15:44:19.880809 2018] [php7:error] [pid 5293] [client 127.0.0.1:46958] PHP Fatal error: Cannot use &#8216;Object&#8217; as class name as it is reserved in \/usr\/share\/zoneminder\/www \/api\/lib\/Cake\/Core\/Object.php on line 30 [Fri Aug 10 15:44:19.889737 2018] [php7:warn] [pid &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[636,61],"class_list":["post-3321","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-cakephp","tag-zoneminder"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/3321","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3321"}],"version-history":[{"count":6,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/3321\/revisions"}],"predecessor-version":[{"id":3355,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/3321\/revisions\/3355"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}