CI 묻고 답하기

제목 require_once 질문.
글쓴이 수야디벨 작성시각 2013/02/14 11:37:28
댓글 : 4 추천 : 0 스크랩 : 0 조회수 : 26190   RSS

Controlelr에서 ruquire_once를 사용하려고 하는데, 경로 때문에 질문 드립니다 :)

우선 Ci은 test라는 폴더의 하위  폴더에 있습니다

test

Ci의

application / asset / ..    + html(제가 사용하는)

그리고 이 html /php/php-image/php_image.php 가 제가 require 하려는 경로인데요.




Ci에서 경로개념이 아직 정확히 잡히지 않아서 ..

require_once('../html/php/php-image/php_image.php');

이렇게 시작을 해서 .

require_once('../../html/php/php-image/php_image.php');

require_once('../../../html/php/php-image/php_image.php');

이런식으로 늘려서 해보고 있는데 , 경로가 제대로 잡히지 않네요 .


아무리  많이 순차적으로 늘려봐도,

require_once() [function.require]: Failed opening required '../../html/php/php-image/php_image.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home//www/test/application//.php on line 2


라는 오류가 나요~ ㅠ

왜그러는걸까요~?
 다음글 IIS에 설치시 rewrite문제 발생 (1)
 이전글 로그인 관련 질문... (2)

댓글

Artz / 2013/02/14 12:21:24 / 추천 0
해당 php 파일 경로를 제대로 못찾아 발생하는 문제 같은데요.
Document Root를 포함한 Full Path를 적어보시면 어떨까 하네요.

수야디벨 / 2013/02/14 12:37:06 / 추천 0
Artz//

도큐멘트 루트라면 , http://...를 포함한 주소인데,

require_once 에 그렇게 쓰면 다른 오류까지 뜨더라구요~ㅜ
인스카 / 2013/02/14 13:37:00 / 추천 0
어떤 파일에서 require_once를 사용하시던지 index.php가 있는 곳을 기준으로 잡으시면 됩니다.

/application/libraries/test.php 가 있다면


require_once('application/libraries/test.php');

라고 하시면 됩니다.
지훈임돠 / 2013/02/14 14:08:00 / 추천 0
클래스나 함수 모음이라면 헬퍼로 사용해보세요^^