Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon Mar 25, 2019 12:56 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Upgrading from v1.1.37 to v1.2.2 and PHP date.timezone error
PostPosted: Wed Feb 27, 2019 10:18 am 
Offline

Joined: Tue Oct 10, 2006 3:30 pm
Posts: 44
Have been running v1.1.37 for a while, decided to upgrade today and during Step 2 it throws an error for date.timezone. It shows it detecting nothing although it is set properly in php.ini and shows up properly in phpinfo(). I have double checked this, tried changing the setting with and without quotes and still no luck. Scratching my head as v1.1.37 installed fine and nothing has changed and now v1.2.2 is flagging this and I'm having no luck.

Ubuntu 16.04 install with Apache 2.4.18 and PHP 7.0.33

https://imgur.com/a/QzG4nxK is screenshot of my phpinfo()

Output from shell
# date
Wed Feb 27 10:03:47 EST 2019
# date -u
Wed Feb 27 15:03:53 UTC 2019
# php -r "echo date('r').PHP_EOL;"
Wed, 27 Feb 2019 10:07:01 -0500

Switching back to v1.1.37 works fine, just would like to be on latest if possible. Searched Google and forum but couldn't find a fix.


Top
 Profile  
 
 Post subject: Re: Upgrading from v1.1.37 to v1.2.2 and PHP date.timezone e
PostPosted: Wed Feb 27, 2019 11:32 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2296
1.2.2 checks both the CLI and the Web PHP.INI's have the timezone value set. You can create a file in your root cacti directory called tz.php and put the following code in it:

Code:
<?php
echo "timezone: " . ini_get('date.timezone') . PHP_EOL;


Then you can run that in your command line using "php -q tz.php" and by browsing to <cacti_url>/tz.php

They should both be the same. If not, you've missed a php.ini somewhere.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Upgrading from v1.1.37 to v1.2.2 and PHP date.timezone e
PostPosted: Wed Feb 27, 2019 12:11 pm 
Offline

Joined: Tue Oct 10, 2006 3:30 pm
Posts: 44
tz.php through browser gave me "timezone: America/New_York"

tz.php through SSH gave me "timezone:"

I'll search for another php.ini file

I found I had 2 php.ini files
/etc/php/7.0/cli/php.ini
/etc/php/7.0/apache2/php.ini

Edited the cli one and issue is fixed.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Bing [Bot] and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group