WP Warning หลัง Upgrade เป็นเวอร์ชัน 3.0
เมื่อวานผม upgrade version ของ wordpress ครับหลังลงก็ไม่ได้เช็คอะไรมากมาย upgrade เสร็จเข้าเว็บได้ก็ไม่สนใจละ จนมาถึงวันนี้เพิ่งสังเกตเห็นว่ามี warning เหมือนข้างล่างเลยมานั่งแก้ bug เล่น
Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/imrgill/:/tmp:/usr/local/lib/php/) in /home/imrgill/domains/imrgill.com/public_html/wp-includes/functions.php on line 2037 Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/imrgill/:/tmp:/usr/local/lib/php/) in /home/imrgill/domains/imrgill.com/public_html/wp-includes/functions.php on line 2028 Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/imrgill/:/tmp:/usr/local/lib/php/) in /home/imrgill/domains/imrgill.com/public_html/wp-includes/functions.php on line 2037
ิวิธีแก้ก็ไม่ยากครับไปแก้ไขไฟล์ /wp-includes/functions.php แล้วไปที่บรรทัด 2028 และ 2037 อย่างที่มันบอกแล้วก็ไปใส่เครื่องหมาย “@” ไว้หน้า function file_exist แล้วก็ is_dir ที่อยู่ในวงเล็บ if ก็เป็นอันหายจากอาการ warning ครับ
if ( @file_exists( $target ) ) return @is_dir( $target ); // Attempting to create the directory may clutter up our display. if ( @mkdir( $target ) ) { $stat = @stat( dirname( $target ) ); $dir_perms = $stat['mode'] & 0007777; // Get the permission bits. @chmod( $target, $dir_perms ); return true; } elseif ( @is_dir( dirname( $target ) ) ) { return false; }
สำหรับใครที่ใช้ plugin WP Super Cache หลังจากแก้ไขไฟล์ function.php แล้วก็อย่าลืมไปเคลียร์ cache ด้วยนะครับ
หวังว่าคงเป็นประโยชน์กับเพื่อนร่วมโลก WP
Leave a Comment June 22, 2010





