apache2 php.ini date.timezone setting will not take!

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
2canchew
Posts: 9
Joined: Mon Oct 18, 2010 4:20 pm

apache2 php.ini date.timezone setting will not take!

Post by 2canchew »

Been trying to fix this for over an hour and now asking for help.

Fresh install of 1.2.21, on a freshly installed server, Ubuntu Server 22.04 LTS.

Begin installation and at the pre-installation checks had an issue with date.timezone for for apache and the cli not set.

Realized the lines were commented out by default, fixed that, restarted apache but the cacti installer is still throwing an error saying it's not set for apache2 php.ini
pre-install check.png
pre-install check.png (52.45 KiB) Viewed 8790 times
looking at phpinfo() it shows that the timezone is set
php timezone.png
php timezone.png (19.19 KiB) Viewed 8790 times
I've searched my system for any and all php.ini files, these are the only two

Code: Select all

root@nas:/var/www/html# find / -name php.ini
/etc/php/8.1/apache2/php.ini
/etc/php/8.1/cli/php.ini
root@nas:/var/www/html#
Also searched these files to make sure my timezone settings were identical

Code: Select all

root@nas:/var/www/html# grep date\\.timezone /etc/php/*/*/php.ini
/etc/php/8.1/apache2/php.ini:; https://php.net/date.timezone
/etc/php/8.1/apache2/php.ini:date.timezone = "America/Toronto"
/etc/php/8.1/cli/php.ini:; https://php.net/date.timezone
/etc/php/8.1/cli/php.ini:date.timezone = "America/Toronto"
Don't know what to do at this point to resolve, any help appreciated.
2canchew
Posts: 9
Joined: Mon Oct 18, 2010 4:20 pm

Re: apache2 php.ini date.timezone setting will not take!

Post by 2canchew »

Can't explain it. I just opened the installer page after dinner and it's all green thumbs up now. :roll:
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: apache2 php.ini date.timezone setting will not take!

Post by TheWitness »

Restarting Apache helps after you make changes. By default, and depending on your version of Apache, it will keep a number of php interpreters memory resident, and once they read certain php values into a session, they stick. So, best to simply restart after making these changes to force the php interpreters to reload.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: apache2 php.ini date.timezone setting will not take!

Post by TheWitness »

It's not every setting, for example, one of the things I love about using PHP is that I can make a change to a PHP file and see the results right away. It's not that simple with other frameworks, like Java/Tomcat/Liberty, and certain other languages.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
jmaris
Posts: 29
Joined: Fri Jan 13, 2012 6:44 am

Re: apache2 php.ini date.timezone setting will not take!

Post by jmaris »

I also encounter this very same issue, and unfortunately, I was not able to resolve this, even after restarting the the entire server a few times.
Cacti v1.2.22
Debian 11
PHP 7.4
Apache2
MariaDB 10.5

The required timezone is UTC.

The error is only present for the PHP - Recommendations (web) and strangely enough, not for the CLI, although the directives in the appropriate php.ini files is exactly the same:

Code: Select all

root@SVR:/etc/mysql# grep date\\.timezone /etc/php/*/*/php.ini
/etc/php/7.4/apache2/php.ini:; http://php.net/date.timezone
/etc/php/7.4/apache2/php.ini:date.timezone = "UTC"
/etc/php/7.4/cli/php.ini:; http://php.net/date.timezone
/etc/php/7.4/cli/php.ini:date.timezone = "UTC"
Any suggestions?

Thanks,
Jan
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: apache2 php.ini date.timezone setting will not take!

Post by TheWitness »

What does the install GUI show?
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
jmaris
Posts: 29
Joined: Fri Jan 13, 2012 6:44 am

Re: apache2 php.ini date.timezone setting will not take!

Post by jmaris »

Hi,

the GUI showed exactly the same as in the thread above: the current PHP date.timezone field in the 'PHP - Recommendations (web)' part remains empty and this item is marked with the error message.

However, it seems that Cacti did some self-healing over the weekend, just as with the initiator of this thread: when I just logged in, all Pre-installation checks are successful now.
Cacti-pre-inst-check.png
Cacti-pre-inst-check.png (75.14 KiB) Viewed 8751 times
There clearly is a time related aspect to this "bug".

Jan
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: apache2 php.ini date.timezone setting will not take!

Post by TheWitness »

What if you try another time zone other than UTC?
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
jmaris
Posts: 29
Joined: Fri Jan 13, 2012 6:44 am

Re: apache2 php.ini date.timezone setting will not take!

Post by jmaris »

hi,
I tried that with Europe/Brussels, but that had the same effect, and I really did want to get it working with the UTC timezone anyhow.
This is now working, but it's strange that this check initially fails (during multiple hours...), while then the system seems to solve itself "overnight".

Jan
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: apache2 php.ini date.timezone setting will not take!

Post by TheWitness »

Yea, very weird.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests