Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 17600128 bytes) in /www/wp-includes/html-api/class-wp-html-tag-processor.php on line 2548

Fatal error: Allowed memory size of 268435456 bytes exhausted
Fatal error: Allowed memory size of 에러 해결책


 워드프레스 에러 로그에 아래와 같은 에러가 발생했다. 그 이유를 알아봤다. 

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 17600128 bytes) in /www/wp-includes/html-api/class-wp-html-tag-processor.php on line 2548


메모장에서 ctrl+G 번호 입력해서 찾으니 아래 코드가 보인다.

$this->html = $output_buffer . substr( $this->html, $bytes_already_copied );

class-wp-html-tag-processor.php의 해당 코드 실행 시점에 PHP가 추가 메모리를 필요로 했는데, 이미 할당된 메모리 한도를 초과해서 에러가 발생했다는 의미다. 이건 원인이라기 보다는 발생 결과에 가깝다. 


조치

워드프레스의 wp-config.php에서 메모리를 늘려졌더니 사라졌다. 

아래 두 라인 사이에 코드를 넣어준다. 


/* Add any custom values between this line and the "stop editing" line. */

define('WP_MEMORY_LIMIT', '512M');

define('WP_MAX_MEMORY_LIMIT', '512M');

/* That's all, stop editing! Happy publishing. */






--- Copyrights © wp.techwillgo.com All rights reserved. 컨텐츠 무단 전재, 복사 및 재배포 금지 ---