พอดีวันนี้ลองลง openx ใน local ปรากฎว่ามัน ขึ้น warning function date-default-timezone-get พอเข้าไปดูใน php.net มันบอกว่าต้องใช้ PHP version 5.1.0 ขึ้นไป ก็เลยตามไปดู phpinfo ดูปรากฎว่า ก็ใช้ 5.3 อยู่แล้ว แต่พอเลื่อนมาดูตรง date ก็เจอ
Warning: phpinfo() [function.phpinfo]: 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 ‘Asia/Bangkok’ for ‘ICT/7.0/no DST’
วิธีแก้ ให้เข้าไปแก้ตามนี้
cd /etc
sudo cp php.ini.default php.ini // ถ้าใครมี php.ini อยู่แล้วข้ามไปเลย
sudo chmod 666 php.ini // เปลี่ยน permission มันซะจะได้แก้มันได้
จากนั้นเข้าไปแก้ php.ini หาบันทัดนี้
;date.timezone =
เอา comment ออกแล้วใส่ timezone ลงไป (http://nl3.php.net/manual/en/timezones.php)
date.timezone = Asia/Bangkok
จากนั้นก็ restart Apache ซะ
sudo apachectl restart
เท่านี้ warning ก็หายแล้วครับผม
February 22nd, 2010
เพิ่งรู้เหมือนกันนะเนี่ย ขอบคุณครับ