เพิ่งเจอปัญหา Wordpress เปิดหน้า homepage ไม่ขึ้นครับ แต่เข้าหน้า Admin ได้ (ผมใช้ WP 3.5.1)
หลังจาก อัด post ไปหลายหมื่นเริ่มเปิดไม่ขึ้น มีแต่ปุ่ม home กับ category และมี error message ประมาณ
allow memory size of ... exhausted ... taxonomy.php
สาเหตุมาจาก post มันเยอะ เวลาโหลด database memory allocation ที่จองโดย PHP มันน้อยเกินกว่าที่จะทำงานได้
วิธีแก้ คือไปปรับ memory allocaton ในไฟล์ default-constants.php ให้สูงขึ้น ตาม code ด้านล่าง เพิ่มจาก 40M -> 200M เลย
ใครขาปั่น post เยอะเกินเก็บไว้ช่วยได้ภายหน้าครับ
xxx/wp-includes]# pwd
xxx/wp-includes
xxx/wp-includes]# vi default-constants.php
function wp_initial_constants( ) {
global $blog_id;
// set memory limits
if ( !defined('WP_MEMORY_LIMIT') ) {
if( is_multisite() ) {
define('WP_MEMORY_LIMIT', '64M');
} else {
define('WP_MEMORY_LIMIT', '200M');
//define('WP_MEMORY_LIMIT', '40M');
}
}