[-문구-Compeople-문구-]

+::Programing::/PHP2011. 10. 23. 22:04

** 기본적인 보안문제가 있는것으로 판단.
** 테스트용으로 사용만 하고.. 지속적인 사용은 검토후 적용 및 판단.

[function.include]: failed to open stream: No such file or directory 에러 발생시 일반적으로 해당 파일의 경로를 못찾아서 발생하는 경로다.
프로그램상에서 일반적으로 "include_once"와 같은 명령어로 상대경로가 아닌 서버 절대경로를 사용하는 경우.. 일반적으로 환경변수를 이용하여 호출하는 경우가 많다. 일반적으로 많이 쓰는 환경변수인 "$DOCUMENT_ROOT"의 경우 해당값을 쓸수 있게 설정이 되어 있지 않으면 호출해서 사용할 수 가 없다.
이와 같은 문제는 보통 $DOCUMENT_ROOT 변수에 대한 설정값을 인식하지 못했을때 발생하게 된다. 이럴때는 Php설정파일에서 "register_globals"값을 "On"을 해 줌으로써 해결이 가능하다.

아래와 같이 수정.(위의 문제는 해당 웹의 환경에 따라 다를 수 있음.)

php.ini 파일에서 다음과 같은 내용을 수정
; You should do your best to write your scripts so that they do not require
; register_globals to be on;  Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
register_globals = On (Off -> On)
/------------------------------------------------------------------------/
DocumentRoot D:/WebServer/homepage
/------------------------------------------------------------------------/
Apache 설정파일에 보면 "DocumentRoot" 항목이 있으며.. php.ini 파일의 환경을
바꿔준후 Apache를 재시작해주면 적용이 된다.


Posted by Compeople
+::Programing::/PHP2011. 10. 23. 13:02

Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.

Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.

위의 에러는 임시폴더에 Session관련 파일생성이 되지 않아서 에러가 나는 경우이다.

1. <? phpinfo; ?>에서 session.save_path 를 확인합니다.
일반적으로  session.save_path = /var/lib/php/session    로 지정됩니다.
# cd /usr/local/Zend/etc/php.ini

[방법1]
session.save_path = /var/lib/php/session   -->   session.save_path = /tmp
[방법2]
session.save_path 의 경로의 퍼미션을 777 로 변경
# chmod 777 /var/lib/php/session

2. 아파치 재실행하기
[방법1] <강추>
# cd /usr/local/apache
# ./bin/apachectl restart

[방법2]
# service httpd restart

관련사이트
http://blue.iegate.net/ver4/bbs/board.php?bo_table=plus03&wr_id=189

** 윈도우 서버의 경우
c:\tmp 등의 폴더를 생성후.
session.save_path = "c:/tmp"    <= c:\ 가 아니고 c:/ 이다.
와 같이 설정후 Apache 재시작해준다.

'+::Programing:: > PHP' 카테고리의 다른 글

PHP, Apache 서버에서의 $DOCUMENT_ROOT변수 인식문제  (0) 2011.10.23
Posted by Compeople