Warning: date(): It is not safe to rely on the system’s timezone settings…

Başlıkta bir hata yok 🙂 Geçen yazımda bahsettiğim eski bir dostuma verdiğim PHP desteği sonrası aktif bilgisayarıma AMPPS kurdum ve biraz kendimi PHP’de güncelleyeyim istedim. Ne de olsa eski dost. Fakat yazdığım ilk ciddi kod blogunu test ederken başlıkta gördüğünüz “Warning: date(): It is not safe to rely on the system’s timezone settings.” hatasını aldım. Sorun basit ama araştıranlar için çözümünü not düşeyim istedim.

Bendeki hatanı tam metni şu;

Warning: 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 the timezone ‘UTC’ for now, but please set date.timezone to select your timezone. in d:/path……

ve

Warning: 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 the timezone ‘UTC’ for now, but please set date.timezone to select your timezone. in d:/path…… on line 1929
SMTP -> ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed
SMTP Error: Could not connect to SMTP host. Mailer Error: SMTP Error: Could not connect to SMTP host.

Güzel ve ciks bir hata 🙂  Çözümü ise basit. PHP.ini dosyanızın aşağıda görünen ~850. satırları civarında bulunan date alanı içinde timezone’u set etmeniz gerekmektedir.

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
; date.timezone =

Üstte görülen alanı, http://php.net/date.timezone adresinde bulunduğunuz lokasyonun kullandığı zaman dilimine göre düzeltirseniz sorunu almazsınız.

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
; date.timezone =
date.timezone = Europe/Istanbul

Hakan Müştak @2016

 

 

 

 


Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

question razz sad evil exclaim smile redface biggrin surprised eek confused cool lol mad twisted rolleyes wink idea arrow neutral cry mrgreen

*

Captcha Kontrolü * Zaman aşımı, sayfayı tekrar yükleyin


Top