CodeIgniter et TimeZone et Log

Classified in : Développement - Tags : php, CodeIgniter

Une erreur de timezone avec CodeIgniter 2.1.4 et PHP 5.4 quand vous utilisez la fonction log_message : voici la solution !

Pour ne plus avoir ce type de message d'erreur en utilisant la fonction log_message :

Strict Standards: date(): 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 /homepages/4/d144600815/htdocs/MAlert/system/libraries/Log.php on line 86

Strict Standards: date(): 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 /homepages/4/d144600815/htdocs/MAlert/system/libraries/Log.php on line 99

Il faut ajouter :

// PHP 5.3 needs this.
if(ini_get('date.timezone') == '')
{
    date_default_timezone_set('Europe/Paris');
}

à partir de la ligne 49 de index.php - celui de la racine - (après la section "Error Reporting").

Si vous voulez une autre time zone, choisissez celle qui vous convient dans la doc PHP.

 

Bon dev !    wink

[ no comments ]

© Le Computing Froggy  !

  • Article Currently 1.00/5
  • 1
  • 2
  • 3
  • 4
  • 5

 Rating : 1.0/5 (2 votes cast)

Write a comment

What is the first letter of the word zbftr? :