{"id":1319,"date":"2019-06-14T16:12:16","date_gmt":"2019-06-14T23:12:16","guid":{"rendered":"http:\/\/dhoytt.com\/mainblog\/?p=1319"},"modified":"2021-12-19T22:18:27","modified_gmt":"2021-12-20T06:18:27","slug":"apache-not-reading-php-ini-changes-configuring-new-zoneminder-install","status":"publish","type":"post","link":"http:\/\/dhoytt.com\/mainblog\/2019\/06\/apache-not-reading-php-ini-changes-configuring-new-zoneminder-install\/","title":{"rendered":"Apache not Reading php.ini Changes Configuring Fedora 30  During New Zoneminder Install"},"content":{"rendered":"\n<p>  <\/p>\n\n\n\n<p>I\nwanted to setup some quick testing of Zoneminder on different\nplatforms last night and started the basic configurations. Installed\nFedora 30 , installed RpmFusion repository, installed mysql community\ndatabase mariadb, Apache installed, install Zoneminder rpms using\n\u201cdnf\u201d etc..<\/p>\n\n\n\n<p>Went\nthrough the initial steps with Zoneminder configurations opened up\nfirewall ports then navigated to the initial web page and got the\nmessage:<\/p>\n\n\n\n<p>\n\u201c<em>ZoneMinder\nis not installed properly: php&#8217;s date.timezone is not set to a valid\ntimezone\u201d <\/em>\n<\/p>\n\n\n\n<p>Should\nbe simple  go into<em> \u201c\/etc\/php.ini\u201d <\/em>set date.timezone\n restart Apache\/HTTPD and get\npast that message\nthen\nget in and do the  initial configurations within Zoneminder but\nthat\u2019s not what happened.<\/p>\n\n\n\n<p>In\n\u201c\/etc\/php.ini I\nset date.timezone to America\/Los_Angeles\nrestarted Apache with systemctl and no changes. Checked for typos and\ninvisible characters in\n\u201c\/etc\/php.ini\u201d restarted\nand nothing changed again. I started checking permissions on web\nfiles, started looking through \u201c\/etc\/http\/conf.d\/php.conf\u201d check\nZonemindr config files everything looks solid but I still get the\n<em>\u201cZoneMinder\nis not installed properly: php&#8217;s date.timezone is not set to a valid\ntimezone\u201d <\/em><em>message<\/em>.<\/p>\n\n\n\n<p>This\nis a minimal install and I\u2019m\nvery\nsure I only have one version of php and Apache. To\nconfirm\nI run:<\/p>\n\n\n\n<p><em>#php\n-i | grep timezone <br>\nDefault\n<strong>timezone<\/strong>\n=&gt; America\/Los_Angeles <br>\ndate.<strong>timezone<\/strong>\n=&gt; America\/Los_Angeles =&gt; America\/Los_Angeles<\/em><\/p>\n\n\n\n<p>This\nshows I have set my timezone parameters properly yet I still get the\nmessage\n\n<em>\u201cZoneMinder\nis not installed properly: php&#8217;s date.timezone is not set to a valid\ntimezone\u201d<\/em><br>\n<br>\n<em>#\nphp -i | grep -i config <\/em><em><br>\n<\/em><em><strong>Config<\/strong><\/em><em>uration\nFile (php.ini) Path =&gt; \/etc <\/em><em><br>\nLoaded\n<\/em><em><strong>Config<\/strong><\/em><em>uration\nFile =&gt; \/etc\/php.ini <\/em><em><br>\n<\/em><em><strong>Config<\/strong><\/em><em>uration\n<\/em><em><br>\nOpenssl\ndefault <\/em><em><strong>config<\/strong><\/em><em>\n=&gt; \/etc\/pki\/tls\/openssl.cnf<\/em><\/p>\n\n\n\n<p><br>\nOnce\nagain looks good and proves I\u2019m editing the only and correct\nphp.ini file but this isn\u2019t translating to  Zoneminder I looked for\noverriding parameters not finding any.<\/p>\n\n\n\n<p>I\nfound many workarounds in forums like providing the date.timezone\nvalue in \u201c\/etc\/http\/conf.d\/php.conf\u201d or going into\n\u201c\/usr\/share\/zoneminder\/www\/index.php\u201d\nand commenting out the code checking date.timezone for\nthe Zoneminder application.\nI don\u2019t want edits and hacks all over in non-default files because\nwhen updating or changing things these things may cause\nissues.<\/p>\n\n\n\n<p>Finally\nI created a phpinfo web page navigate to it and date.timezone\nvalue is\nblank!! Doing\n\u201cphp -i\u201d shows properly still!<\/p>\n\n\n\n<p><em>#php\n-i | grep timezone <br>\nDefault\n<strong>timezone<\/strong>\n=&gt; America\/Los_Angeles <br>\ndate.<strong>timezone<\/strong>\n=&gt; America\/Los_Angeles =&gt; America\/Los_Angeles<\/em><\/p>\n\n\n\n<p>Ok\nso obviously php.ini isn\u2019t passing the date.timezone parameter to\nApache for some reason even though the phpinfo web page shows it\u2019s\nusing the \u201c\/etc\/php.ini\u201d configuration file for php!<\/p>\n\n\n\n<p>I\nchecked the current Zoneminder system and they are\nsetup with Apache and PHP identically\nexcept the OS versions\nFedora 28 versus Fedora 30 so I started searching for difference in\nthe versions and found what I needed in the Fedora forums. FastCGI&nbsp;is\nnow a required\ndependency\nfor Apache\/httpd via the \u201cphp-fpm\u201d service.<\/p>\n\n\n\n<p>#systemctl\nstatus php-fpm<\/p>\n\n\n\n<p>php-fpm.service\n&#8211; The PHP FastCGI Process Manager<br>\n<br>\n\n<\/p>\n\n\n\n<p>I noticedphp-fpm has not been restarted since I made my changes in \u201c\/etc\/php.ini\u201d so now I decide to restart \u201cphp-fpm\u201d and the <em> \u201cZoneMinder is not installed properly: php&#8217;s date.timezone is not set to a valid timezone\u201d <\/em>message is gone so now I can actually configure Zoneminder with my cameras!<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"620\" height=\"211\" data-attachment-id=\"1321\" data-permalink=\"http:\/\/dhoytt.com\/mainblog\/2019\/06\/apache-not-reading-php-ini-changes-configuring-new-zoneminder-install\/image\/\" data-orig-file=\"https:\/\/i0.wp.com\/dhoytt.com\/mainblog\/wp-content\/uploads\/sites\/3\/2019\/06\/image.png?fit=995%2C339\" data-orig-size=\"995,339\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/dhoytt.com\/mainblog\/wp-content\/uploads\/sites\/3\/2019\/06\/image.png?fit=300%2C102\" data-large-file=\"https:\/\/i0.wp.com\/dhoytt.com\/mainblog\/wp-content\/uploads\/sites\/3\/2019\/06\/image.png?fit=620%2C211\" src=\"https:\/\/i0.wp.com\/dhoytt.com\/mainblog\/wp-content\/uploads\/sites\/3\/2019\/06\/image.png?resize=620%2C211\" alt=\"\" class=\"wp-image-1321\" srcset=\"https:\/\/i0.wp.com\/dhoytt.com\/mainblog\/wp-content\/uploads\/sites\/3\/2019\/06\/image.png?w=995 995w, https:\/\/i0.wp.com\/dhoytt.com\/mainblog\/wp-content\/uploads\/sites\/3\/2019\/06\/image.png?resize=300%2C102 300w, https:\/\/i0.wp.com\/dhoytt.com\/mainblog\/wp-content\/uploads\/sites\/3\/2019\/06\/image.png?resize=768%2C262 768w, https:\/\/i0.wp.com\/dhoytt.com\/mainblog\/wp-content\/uploads\/sites\/3\/2019\/06\/image.png?resize=640%2C218 640w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/figure>\n\n\n\n<p>Basically\nthis is what\u2019s needed to\nmake sure your changes you make in \/etc\/php.ini are passed on to\nApache in Fedora 30 and possibly other versions starting at Fedora 27\nthough I didn\u2019t have this issue with Fedora 28 or\nI didn&#8217;t\nnotice it for some reason:<\/p>\n\n\n\n<p>#vi\n\/etc\/php-fpm.conf   \n<\/p>\n\n\n\n<p>\nMake\nthis change:<\/p>\n\n\n\n<p>date.<strong>timezone<\/strong>\n= America\/Los_Angeles<\/p>\n\n\n\n<p>#\nsystemctl restart httpd<br>\n<br>\n#\nsystemctl restart php-fpm<br>\n<br>\n\n<\/p>\n\n\n\n<p>Verify\nby creating a pphpinfo file and navigating to it<br>\n<br>\nContents\nof phpinfo.php:<\/p>\n\n\n\n<p>&lt;?php\nphpinfo(); ?&gt;<br>\n<br>\nExample:<\/p>\n\n\n\n<p>#cat \/var\/www\/html\/phpinfo.php  <br> &lt;?php phpinfo(); ?&gt; <br> <\/p>\n\n\n\n<p># <br><br><br><br><\/p>\n\n\n\n<p>Fedora\nforum posts that pointed me in the right direction:<\/p>\n\n\n\n<p><a href=\"https:\/\/forums.fedoraforum.org\/showthread.php?317215-Apache-PHP-Configuration\">https:\/\/forums.fedoraforum.org\/showthread.php?317215-Apache-PHP-Configuration<\/a>\nwhich referenced:<\/p>\n\n\n\n<p><a href=\"https:\/\/blog.remirepo.net\/post\/2017\/11\/17\/Fedora-27-changes-in-http-and-php\">https:\/\/blog.remirepo.net\/post\/2017\/11\/17\/Fedora-27-changes-in-http-and-php<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to setup some quick testing of Zoneminder on different platforms last night and started the basic configurations. Installed Fedora 30 , installed RpmFusion repository, installed mysql community database mariadb, Apache installed, install Zoneminder rpms using \u201cdnf\u201d etc.. Went &hellip; <a href=\"http:\/\/dhoytt.com\/mainblog\/2019\/06\/apache-not-reading-php-ini-changes-configuring-new-zoneminder-install\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1321,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"wprm-recipe-roundup-name":"","wprm-recipe-roundup-description":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5,7],"tags":[749,304,604,756,752,516,754,132,751,150,305,750,753,255,755,735],"class_list":["post-1319","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-home-projects","category-technical-non-site-related","tag-apache","tag-database","tag-dnf","tag-fc30","tag-fedora-30","tag-firewall","tag-httpd","tag-linux","tag-mariadb","tag-mysql","tag-php","tag-php-ini","tag-rpm","tag-systemctl","tag-timezone","tag-zoneminder"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/dhoytt.com\/mainblog\/wp-content\/uploads\/sites\/3\/2019\/06\/image.png?fit=995%2C339","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/posts\/1319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/comments?post=1319"}],"version-history":[{"count":5,"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/posts\/1319\/revisions"}],"predecessor-version":[{"id":1325,"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/posts\/1319\/revisions\/1325"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/media\/1321"}],"wp:attachment":[{"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/media?parent=1319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/categories?post=1319"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/tags?post=1319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}