System: Debian Lenny/Apache 2.2/php5.3.3 compiled from sources
I'm strugglying with the date.timezone within php.ini.
I can define the TZ using in the php source code but I'd like to fix that at once in the ini file.
php code : Ok
date_default_timezone_set('Europe/Berlin');
php.ini : Not taken into consideration if not setup within the source code
date.timezone = 'Europe/Berlin'
I also checked that I modified the right php.ini file and have interference with some php.default.ini files.
I checked within the apache config files whether there would be an interfering TZ env data, but none.
Don't know what to do more, so any hints will be welcomed,
thx in advance.
EDIT: I also tried with no or single or double quotes as date.timezone = 'Europe/Berlin' but I still get a "no value" in the phpinfo.
EDIT2: Both phpinfo() and the below test script return that the date.timezone is empty (eg. no value) :
date_default_timezone_set('America/Los_Angeles');
$script_tz = date_default_timezone_get();
$iniset = ini_get('date.timezone') ;
if (strcmp($script_tz, $iniset)){
echo "Script timezone ($script_tz) differs from ini-set timezone ($initset).";
} else {
echo "Script timezone ($script_tz) and ini-set timezone match.";
}
EDIT3: hum, I guess I found sthg in the php.ini :
Configuration File (php.ini) Path : /usr/local/php533/php.ini
Loaded Configuration File : VOID !
So I have to find the way to make sure Apache is looking for the right php.ini somehow...
The default timezone for PHP is UTC regardless of your server's timezone. This is the timezone used by all PHP date/time functions in your scripts.
I think you're missing the quotes:
date.timezone = "Europe/Berlin"
The value is a string according to: ini.date.timezone on PHP.net which must be wrapped in quotes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With