질문&답변
클라우드/리눅스에 관한 질문과 답변을 주고 받는 곳입니다.
리눅스 분류

php에러로그좀 잡아주세요..몇일째헤매고있네요

작성자 정보

  • 삽질신 작성
  • 작성일

컨텐츠 정보

본문

문제의 요점을 말해드리겠습니다.

cpu점유율이 99%까지 올라갔습니다. 리소스를 보니 apache가 다잡아먹고있었구요

따라서 apache 데몬 다시 구동하려하니 443포트를 잡고있어서 안되더라구요.

그래서 killall로 강제로 죽이면 가능해지고 점유율도 떨어집니다.

그런데 조금후 다시 살아납니다. 시간 간격은 하루가 될수도 있고 5시간이 될수도 있구요

그래서 에러로그를 보기로 했는데 php에서 에러가 수시로 발생되고 있더라구요




[root@sab etc]# tail -f /var/log/httpd/error_log
[client 61.78.100.147] PHP Notice:  Undefined variable:  logout in /teacher/jinhak/html/chuiup/recmd/login.php on line 13, referer: http://211.241.40.51/~jinhak/chuiup/recmd/menu.htm
[client 61.78.100.147] PHP Notice:  Undefined variable:  id in /teacher/jinhak/html/chuiup/recmd/login.php on line 17, referer: http://211.241.40.51/~jinhak/chuiup/recmd/menu.htm
[Wed May 16 13:39:19 2007] [error] [client 65.55.212.164] File does not exist: /home/www-sys/html/systel.htm
[client 61.78.100.147] PHP Notice:  Undefined variable:  logout in /teacher/jinhak/html/chuiup/recmd/login.php on line 13, referer: http://211.241.40.51/~jinhak/chuiup/recmd/login.php
[Wed May 16 13:39:30 2007] [error] [client 207.46.98.36] File does not exist: /home/www-sys/html/~chuitadae
[Wed May 16 13:39:36 2007] [error] [client 74.6.74.181] File does not exist: /home/www-sys/html/news
[Wed May 16 13:39:43 2007] [error] [client 220.68.200.131] File does not exist: /home/www-sys/html/~shinji, referer: http://kin.naver.com/db/detail.php?d1id=8&dir_id=80608&eid=UUTQS/DfQJG/N37jQIiCXKKZG/IGnyJI&qb=xKHB7sTJn W4uLXltMK5/Q==
[Wed May 16 13:39:43 2007] [error] [client 220.68.200.131] File does not exist: /home/www-sys/html/~shinji, referer: http://kin.naver.com/db/detail.php?d1id=8&dir_id=80608&eid=UUTQS/DfQJG/N37jQIiCXKKZG/IGnyJI&qb=xKHB7sTJn W4uLXltMK5/Q==
[Wed May 16 13:39:59 2007] [error] [client 69.60.120.166] File does not exist: /home/www-sys/html/robots.txt
[Wed May 16 13:42:35 2007] [error] [client 125.251.119.65] File does not exist: /home/www-sys/html/sub3/css, referer: http://www.sys.hs.kr/fla/sub_1_top.swf
[client 66.249.66.10] PHP Notice:  Undefined variable:  _head_php_excuted in /circle/library/html/zboard/_head.php on line 5
[client 66.249.66.10] PHP Notice:  Undefined variable:  _zb_path in /circle/library/html/zboard/_head.php on line 13
[client 66.249.66.10] PHP Notice:  Undefined variable:  _zb_path in /circle/library/html/zboard/_head.php on line 14
[client 66.249.66.10] PHP Notice:  Undefined variable:  _view_included in /circle/library/html/zboard/view.php on line 6
[client 66.249.66.10] PHP Notice:  Undefined variable:  _head_php_excuted in /circle/library/html/zboard/_head.php on line 5
[client 66.249.66.10] PHP Notice:  Undefined variable:  _zb_path in /circle/library/html/zboard/_head.php on line 13
[client 66.249.66.10] PHP Notice:  Undefined variable:  _zb_path in /circle/library/html/zboard/_head.php on line 14
[Wed May 16 13:47:57 2007] [error] [client 65.55.208.252] File does not exist: /home/www-sys/html/robots.txt
[client 66.249.66.10] PHP Notice:  Undefined variable:  _view_included in /circle/library/html/zboard/view.php on line 6
[client 66.249.66.10] PHP Notice:  Undefined variable:  _head_php_excuted in /circle/library/html/zboard/_head.php on line 5
[client 66.249.66.10] PHP Notice:  Undefined variable:  _zb_path in /circle/library/html/zboard/_head.php on line 13
[client 66.249.66.10] PHP Notice:  Undefined variable:  _zb_path in /circle/library/html/zboard/_head.php on line 14
[client 66.249.66.10] PHP Warning:  Call-time pass-by-reference has been deprecated - argument passed by value;  If you would like to pass it by reference, modify the declaration of [runtime function name]().  If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file.  However, future versions may not support this any longer.  in /circle/library/html/zboard/zboard.php on line 197
[client 66.249.66.10] PHP Warning:  Call-time pass-by-reference has been deprecated - argument passed by value;  If you would like to pass it by reference, modify the declaration of [runtime function name]().  If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file.  However, future versions may not support this any longer.  in /circle/library/html/zboard/zboard.php on line 207
[client 66.249.66.10] PHP Notice:  Undefined variable:  _head_php_excuted in /circle/library/html/zboard/_head.php on line 5
[client 66.249.66.10] PHP Notice:  Undefined variable:  _zb_path in /circle/library/html/zboard/_head.php on line 13
[client 66.249.66.10] PHP Notice:  Undefined variable:  _zb_path in /circle/library/html/zboard/_head.php on line 14
[Wed May 16 13:51:37 2007] [error] [client 125.133.44.136] File does not exist: /home/www-sys/html/favicon.ico



------------------------------------------------------------------------------


참고로 php.ini 파일중에서  error_reporting  =  E_ALL & ~E_NOTICE 는 했습니다.

관련자료

댓글 2

이자선님의 댓글

  • 이자선
  • 작성일
우선 php 에 대해서 쥐뿔도 모르는 제가 몇자 끼적여 보겠습니다.
(정확도에 대한 보장은 없습니다만 에러로그를 정확히 해석해 드리겠습니다.)

이거 아파치의 문제라기 보다는 php 코드의 결함일 확률이 매우 높습니다.
php 코드를 잘못작성할 경우 보안의 위험성 또한 매우 높구요.
이미 당하셨을지도 ...

우선 위에 나열된 에러의 의미부터

* 알림수준
PHP Notice : Undefined variable : [변수명] in [파일패스] on line [라인번호]
<- 정의되지 않은 변수를 참조했다는 겁니다.
파일패스의 몇번째 라인에 있는 변수가 정의되지 않았다는 의미 입니다.

* 경고수준
Call-time pass-by-reference has been deprecated
호출될 때 pass-by-reference 하는 행위가 deprecated 되었다는 의미입니다.
deprecated 는 보통 결함이 발견되어 다른 방법으로 대체할 수 있게
해놓았는데 이전의 방식을 그대로 사용했다는 의미입니다.
(대부분 deprecated는 보안의 결함때문에 새로운 방식을 권장하는 것이니
deprecated 된 방식을 사용하는 것은 매우 위험한 행위중 하나입니다)

그 뒤 문구는
argument passed by value <- 인자가 값으로 전달되었다.
If you would like to pass it by reference, modify the declaration of [runtime function name](). 
만약 참조전달을 하고 싶다면 runtime 함수 이름 선언을 수정하라!
If you would like to enable call-time pass-by-reference,
you can set allow_call_time_pass_reference to true in your INI file. 
However, future versions may not support this any longer.
만약 call-time pass-by-reference 를 사용할 수 있게 하려면
INI 파일에서(아마도 php.ini겠져) allow_call_time_pass_reference 를 true 로 세팅하라.
하지만 향후 버젼부터는 더이상 지원하지 않을것이다.
(deprecated 된 행위는 되도록 사용하지 않는것이 좋으며 사용하려면 변수
설정을 true 로 바꾸라는 것인데, deprecated 는 중간 호환을 위해서
잠시 방치해두는것이지 그 뒷버젼부터는 거의 사라지게 됩니다.)

 /circle/library/html/zboard/zboard.php on line 207
위 파일패스의 207 라인에서 call-time pass-by-reference 행위를 했다는 것 같습니다.

(제 개인적인 의견으로도 deprecated 된 call-time pass-by-reference 는
사용하지 않는게 좋을 것 같습니다. zboard 면 zeroboard 인가본데 ...
zeroboard 최신버젼을 사용하시기 바랍니다.)

* 에러수준
File does not exist: 파일패스
<- 해당파일이 존재하지 않는다는 오류입니다.
(파일이 다른서버에 존재하거나 같은 서버에 존재해도
접근할수 없었을때 발생할 수 있습니다.)

이자선님의 댓글

  • 이자선
  • 작성일
부가적으로 하드디스크의 용량을 한번 체크해보시기 바랍니다.
tmp 파티션을 따로 잡아두지 않으셨다면 이미
루트파일 시스템(/) 의 용량이 거의 제로에 가깝게 치닫고 있을수도 있습니다.

따로 잡아두셨다면 tmp 파티션이 쓰레기 파일들로 가득차서
그게 아니라면 위 에러와 경고를 토대로 코드를 수정하시는걸
강력 추천드리며 ~ 게시판 같은것들은 최신버젼으로 바꾸어주시는게
좋을것 같습니다.

일단 쓰레기 파일들이 보인다면 죄다 삭제하시기 바라며
서비스 용도의 코드라면 코드를 죄다 고친후에는 깔끔하게 리눅스를 밀고
새로 설치하시기를 강추드립니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,070 명
  • 현재 강좌수 :  35,986 개
  • 현재 접속자 :  325 명