에러로그에 이미 정의된 메모리 한계치라는 에러가 뜨는 경우가 있다. 어떻게 조치하는지 알아봤다.
PHP Warning: Constant WP_MEMORY_LIMIT already defined in /www/wp-config.php on line 123
보통 이러한 메시지가 에러 로그에 뜰 경우는 에러가 뜬 라인을 확인을 한다. 아래 부분이었다.
define( 'WP_MEMORY_LIMIT', '256M' );
위의 에러가 빈번하게 뜨는 이유는 위 코드를 정확한 위치에 적지 않아서 이다. 보통 wp-config.php 파일 마지막에 적거나 /* That's all, stop editing! Happy publishing. */ 라인 밑에 적는 경우 에러가 발생할 수 있다.
관련글: wp-config.php 파일에서 /* That's all, stop editing! Happy publishing. */의 의미
https://wp.techwillgo.com/2026/07/wp-config-php-thats-all-stop-editing.html
조치법
아래 위치에 적으면 에러가 뜨지 않는다.
/* Add any custom values between this line and the "stop editing" line. */
define('WP_MEMORY_LIMIT', '256M');
define('WP_MAX_MEMORY_LIMIT', '256M');
/* That's all, stop editing! Happy publishing. */