Author Topic: SMF 8192: preg_replace(): The /e modifier is deprecated, use preg_replace_callba  (Read 4061 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
SMF 8192: preg_replace(): The /e modifier is deprecated, use preg_replace_callba
« 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;