增加XAMPP記憶體不足問題、三種方式








※本篇內文資訊參考如下※



- -

※更新文章日期: 2017-08-02

ERROR.LOG錯誤碼如下
Fatal error: Allowed memory size of XXXX bytes exhausted (tried to allocate XXXX bytes)

三種方式

第一種
.htaccess 新增
php_value memory_limit 256M

第二種
php.ini改
memory_limit=256M










第三種
C:\xampp\htdocs\網站資料夾\
wp-includes\default-constants.php修改

// Define memory limits.
if ( ! defined( ‘WP_MEMORY_LIMIT’ ) ) {
if ( false === wp_is_ini_value_changeable( ‘memory_limit’ ) ) {
define( ‘WP_MEMORY_LIMIT’, $current_limit );
} elseif ( is_multisite() ) {
define( ‘WP_MEMORY_LIMIT’, ‘256M’ );
} else {
define( ‘WP_MEMORY_LIMIT’, ‘128M’ );
}








-

-