Home 게시판 커뮤니티 Q&A wp-config.php 설정 후 저장할 때 한가지 주의 사항

Tagged
4개 답변, 2 voices Last updated by Avatar of GosingaGosinga 18 years, 3 months 전
  • Avatar of 그림동화그림동화
    Keymaster
    @그림동화
    #487

    아직 많은 오픈 소스부분에서.. 년도 표기가… 외국에 맞추어져 있는게 사실입니다. ~
    여러 국가를 상대(?)하는 오픈소스라면… 분명히 고려해야 할 문제가 아닌가.. 싶네요~

    Avatar of 그림동화그림동화
    Keymaster
    @그림동화
    #488

    (wp-config.php 설정 후 저장 할때는 ANSI 인코딩으로 하여야 합니다.)

    처음 Word Press를 설치 할때 계속 아래와 같은 에러가 발생했습니다.

    Warning: Cannot modify header information – headers already sent by (output started at /home/fromto/public_html/wordpress/wp-config.php:1) in /…/wp-login.php on line 7

    Warning: Cannot modify header information – headers already sent by (output started at /home/fromto/public_html/wordpress/wp-config.php:1) in /…./wp-login.php on line 8

    Warning: Cannot modify header information – headers already sent by (output started at /home/fromto/public_html/wordpress/wp-config.php:1) in /…/wp-login.php on line 9

    Warning: Cannot modify header information – headers already sent by (output started at /home/fromto/public_html/wordpress/wp-config.php:1) in /…/wp-login.php on line 10

    http://www.wordpress.org 의 포럼에 같은 에러를 발생한 유저들이 몇명 있었지만 해결책을 찾지 못했습니다.. (공백을 제거해라 ASCII 모드로 업로드하라는 했지만 계속 에러가 발생했습니다.)

    알고 보니 원인은 바로 wp-config.php 파일에 있었습니다. wp-config.php 환경 설정하고 저장 할때 인코딩을 UTF-8 로 하여 에러가 발생했던 것입니다.

    wp-config.php을 저장 할때 ANSI 인코딩으로 되어있는지 확인하여야 합니다.

    Avatar of 그림동화그림동화
    Keymaster
    @그림동화
    #490

    (wp-config.php 설정 후 저장 할때는 ANSI 인코딩으로 하여야 합니다.)

    처음 Word Press를 설치 할때 계속 아래와 같은 에러가 발생했습니다.

    Warning: Cannot modify header information – headers already sent by (output started at /home/fromto/public_html/wordpress/wp-config.php:1) in /…/wp-login.php on line 7

    Warning: Cannot modify header information – headers already sent by (output started at /home/fromto/public_html/wordpress/wp-config.php:1) in /…./wp-login.php on line 8

    Warning: Cannot modify header information – headers already sent by (output started at /home/fromto/public_html/wordpress/wp-config.php:1) in /…/wp-login.php on line 9

    Warning: Cannot modify header information – headers already sent by (output started at /home/fromto/public_html/wordpress/wp-config.php:1) in /…/wp-login.php on line 10

    http://www.wordpress.org 의 포럼에 같은 에러를 발생한 유저들이 몇명 있었지만 해결책을 찾지 못했습니다.. (공백을 제거해라 ASCII 모드로 업로드하라는 했지만 계속 에러가 발생했습니다.)

    알고 보니 원인은 바로 wp-config.php 파일에 있었습니다. wp-config.php 환경 설정하고 저장 할때 인코딩을 UTF-8 로 하여 에러가 발생했던 것입니다.

    wp-config.php을 저장 할때 ANSI 인코딩으로 되어있는지 확인하여야 합니다.

    Avatar of GosingaGosinga
    Participant
    @Gosinga
    #489

    맞아요. 워드프레스 문서에서는 이러한 문제를 해결하려면 불필요한 공백을 제거하라는 등의 조언을 하고 있지만, 파일을 utf-8로 저장해서 사용해야 하는 사용자의 입장에서는 해결이 되지 않지요.

    예컨대 sidebar.php의 wp_get_archives(‘type=monthly’) 함수를 호출할 때 “2006년 1월” 식으로 연월표기를 하고 싶다면, utf-8 인코딩를 사용하는 사용자는 wp_get_archives(‘type=monthly’) 함수를 정의하고 있는 wp-includes/template-functions-general.php 파일을 수정하는 수밖에 없습니다. 이때 한글 “년”을 삽입하고 이 파일을 utf-8로 저장해야 하는데, 그러면 Headers already sent … 이하의 문제가 발생하게 됩니다.

    이러한 사례는 wp-includes/ 디렉토리 내의 파일은 어떤 파일이든 utf-8로 저장하면 안된다는 이야기이기도 합니다. wp-includes/ 디렉토리 내의 파일을 수정하지 않는 것이 워드프레스 정책이고 또 그 정책을 따르는 것이 최선이지만, 서양식 역법만 고려하고 동양식 역법을 고려하지 않은 함수 정의는 수정되어야 할 부분이라고 생각합니다.

    즉, wp_get_archives(‘type=monthly’) 함수의 정의를 수정해서 동양식의 역법표기도 쉽게 가능하게 해야 하지 않을까 생각됩니다.

    Avatar of GosingaGosinga
    Participant
    @Gosinga
    #491

    맞아요. 워드프레스 문서에서는 이러한 문제를 해결하려면 불필요한 공백을 제거하라는 등의 조언을 하고 있지만, 파일을 utf-8로 저장해서 사용해야 하는 사용자의 입장에서는 해결이 되지 않지요.

    예컨대 sidebar.php의 wp_get_archives(‘type=monthly’) 함수를 호출할 때 “2006년 1월” 식으로 연월표기를 하고 싶다면, utf-8 인코딩를 사용하는 사용자는 wp_get_archives(‘type=monthly’) 함수를 정의하고 있는 wp-includes/template-functions-general.php 파일을 수정하는 수밖에 없습니다. 이때 한글 “년”을 삽입하고 이 파일을 utf-8로 저장해야 하는데, 그러면 Headers already sent … 이하의 문제가 발생하게 됩니다.

    이러한 사례는 wp-includes/ 디렉토리 내의 파일은 어떤 파일이든 utf-8로 저장하면 안된다는 이야기이기도 합니다. wp-includes/ 디렉토리 내의 파일을 수정하지 않는 것이 워드프레스 정책이고 또 그 정책을 따르는 것이 최선이지만, 서양식 역법만 고려하고 동양식 역법을 고려하지 않은 함수 정의는 수정되어야 할 부분이라고 생각합니다.

    즉, wp_get_archives(‘type=monthly’) 함수의 정의를 수정해서 동양식의 역법표기도 쉽게 가능하게 해야 하지 않을까 생각됩니다.

5 글 보임 - 1에서 5 까지 (총 5 중에서)
  • 답변은 로그인 후 가능합니다.