Golfreeze.packetlove.com: Life style of Golfreeze Canon400D Family kammtan.com Jazz Freebsd Unix Linux System Admin guitar Music

All about unix linux freebsd and FAQ for Packetlove.com Web hosting , Mail hosting , VoIP + IP PBX server => all application on unix knowledges by golfreeze => Topic started by: golfreeze on สิงหาคม 27, 2016, 09:59:48 AM

Title: SMF 8192: preg_replace(): The /e modifier is deprecated, use preg_replace_callba
Post by: golfreeze on สิงหาคม 27, 2016, 09:59:48 AM
8192: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
: Board SMF /Sources/Load.php(198) : runtime-created function

ส่วนใหญ่ถ้าเกิดจะเป็นกับ PHP 5.5 เนื่องจากมีการเลิกใช้งาน คำสั่ง preg_replace() ครับ
ถ้าแก้ไขปัญหาสามารถ ไปเพิ่มให้ php รู้ว่าข้าม error นี้ไป

เข้าไปที่ Sources/Errors.php
ทำการ copy file ไว้ก่อน
แล้วค่อยเข้าไปแก้ไข
โดยค้นหา PHP 4
// Ignore errors if we're ignoring them or they are strict notices from PHP 5 (which cannot be solved without breaking PHP 4.)
  if (error_reporting() == 0 || (defined('E_STRICT') && $error_level == E_STRICT && (empty($modSettings['enableErrorLogging']) || $modSettings['enableErrorLogging'] != 2)))
    return;

แล้วเพิ่มโคดของ PHP 5.5 ลงไปครับ
  // Ignore errors if we're ignoring them or they are strict notices from PHP 5 (which cannot be solved without breaking PHP 4.)
  if (error_reporting() == 0 || (defined('E_STRICT') && $error_level == E_STRICT && (empty($modSettings['enableErrorLogging']) || $modSettings['enableErrorLogging'] != 2)))
    return;
  // Disable PHP 5.5 "DEPRECATED"  errors from filling the forum error logs
  if (defined('E_DEPRECATED') && $error_level == E_DEPRECATED)
    return;