+34 911 599 883

+34 911 895 172

Establecer date.timezone = “Europe/Madrid” en php.ini

Nos econtramos este error en los logs de nuestros servidores PLESK 9.5 con PHP 5.3:

Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /var/www/vhosts/fdominio/httpdocs/archivo.php on line 56

La solución consiste en editar /etc/php.ini y establecer la zona horaria por defecto :

; Module Settings ;

; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
date.timezone = "Europe/Madrid"

Para que los cambios de configuración se vean reflejados hace falta reiniciar el servicio de Apache:

service httpd restart