25.7.11

Corregir "warning" del timezone en PHP 5.3

Si actualizaron PHP en su servidor y ven millones de errores del timezone como este:

PHP Warning: mktime(): 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 'America/Buenos_Aires' for 'EDT/-3.0/DST'
instead in page.php on line 1

Van a tener que configurar el parametro date.timezone en el archivo php.ini que este usando su servidor web (en mi caso esta en /etc/php.ini) y agregarle la zona correspondiente.

;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[Date]
; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
date.timezone = America/Buenos_Aires

Si no saben en donde esta el archivo php.ini que tienen que modificar, pueden crear un archivo PHP con este codigo:

<?php phpinfo(); ?>

Y acceder a dicho archivo desde el navegador. Ahi van a encontrar la ruta al archivo php.ini del cual necesitan modificar el timezone.

No hay comentarios.: