PDA

View Full Version : PHP Timezone pre-requisite fails


kdx200rider
13-04-2009, 16:40
Hello,

Installing Zabbix 1.6.4 on a VM running CentoS 5.3 64 bit. Install seemed to go fine, I used the script from Brendon Baumgartner.

I wanted to see how the DB connection was setup so I selected Installation from the Administration menu. When I get to the pre-requisites window I see a "Fail" in the PHP timezone test. The timezone is set and is displayed properly but still fails. I'm sure the /etc/php.ini file is being read, if I change the timezone value it is reflected in the pre-requisite check.

Has anyone run into this before?

Here are my details:

Zabbix 1.6.4
CentOS 5.3 64 bit
php-5.1.6-23.2.el5_3
httpd-2.2.3-22.el5
mysql-server-5.0.45-7.el5

tchjts1
13-04-2009, 18:10
Just to double-check, have you verified your php.ini "date.timezone=" entry here to make sure spacing/capitalization are correct?

http://us3.php.net/manual/en/timezones.php

Make any necessary changes to your php.ini and then re-run your prerequisite check.

kdx200rider
13-04-2009, 19:27
Thanks for replying tchjts1.

I did actually. I tried to cut and paste the value and also tried just typing it in. The value I am using is "America/New_York". So the line in the config looks like:

date.timezone=America/New_York

Thanks for help!

tchjts1
13-04-2009, 19:31
Try a space before and after the = sign, like so...

date.timezone = America/Los_Angeles

That is how mine is. Dunno if that makes a difference.

Oh, and so we are not overlooking an obvious... this is the file you are editing, correct? /etc/php5/apache2/php.ini

kdx200rider
13-04-2009, 20:30
Thanks I did try that and it did not seem to help.

The file I have is /etc/php.ini, I searched for others on this system but could not find any.

I believe it is the file that Zabbix is looking at, if I put an "X" at the end. I see the "X" appear in the Zabbix pre-requistes page.

kdx200rider
13-04-2009, 21:23
I believe I have found the problem. I took at look at our existing Zabbix 1.4.6 server and found a difference in the /var/www/html/zabbix/include/setup.inc.php file compared to our 1.6.4 version.

1.4.6 Version:

$tmezone = ini_get('date.timezone');
$table->AddRow(
$this->get_test_result(
$final_result,
'PHP Timezone:',
empty($tmezone) ? 'n/a' : $tmezone,
!empty($tmezone),
'Timezone for PHP is not set. Please set "date.timezone" option in php.ini.'));
unset($tmezone);

1.6.4 Version:

$tmezone = ini_get('date.timezone');
$table->AddRow(
$this->get_test_result(
$final_result,
'PHP Timezone:',
empty($tmezone) ? 'n/a' : $tmezone,
empty($tmezone),
'Timezone for PHP is not set. Please set "date.timezone" option in php.ini.'));
unset($tmezone);

The "empty($tmezone)" line seemed to be missing a "!". I added it to our 1.6.4 setup.inc.php file and the pre-requisite test complete successfully.

t2y
14-04-2009, 01:45
Hi kdx200rider,

In my case, I have set related to apache configuration.
Does it work for you?

# cat /etc/httpd/conf.d/zabbix.conf
Alias /zabbix /usr/share/zabbix
<Directory "/usr/share/zabbix">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
php_value max_execution_time 300
php_value date.timezone Asia/Tokyo
</Directory>

kdx200rider
15-04-2009, 20:20
Thanks t2y,

The code fix mentioned above has solved my problem. I will try your suggestion also.

Mikrodots
06-07-2009, 18:40
I believe I have found the problem. <SNIP>

The "empty($tmezone)" line seemed to be missing a "!". I added it to our 1.6.4 setup.inc.php file and the pre-requisite test complete successfully.

Same fix worked for me on Centos 5.5 64Bit in a Virtual Machine but my file was here:
/usr/local/share/zabbix/include/setup.inc.php

I used the script from Brendon Baumgartner as well.

# nano /usr/local/share/zabbix/include/setup.inc.php

Add ! in front of the line:
empty($tmezone),

So it looks like this:
empty($tmezone) ? 'n/a' : $tmezone,
!empty($tmezone),

Mikrodots