본문 바로가기

Study/Web Programing

Warning: include() [function.include]: URL file-access is disabled in the server configuration

Jessica
Jessica by 旅の達人黒沢オティス 저작자 표시비영리동일조건 변경허락

제 기억상으로는 php include("주소") 쓰면 그 웹페이지를 불러오는 기능이 있던것 같습니다 - 일단 제기억상으로는 그렇게 이용했던것 같고.. 예전에 제가 어떤 목적인지는 몰라도 아이프레임 안쓰려고 이거 쓴거 같거든요.

물론. 제가 PHP를 잘하는것도 아니고 깔짝 배운거라 ㅠㅠ 구글신께 물어볼것이 생겼습니다.
예를들어 이런거죠.

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/www/jesica.php on line 3

Warning: include(http://www.daum.net) [function.include]: failed to open stream: no suitable wrapper could be found in /home/www/jesica.php on line 3

Warning: include() [function.include]: Failed opening 'http://www.jesica.co.kr' for inclusion (include_path='.:/usr/local/server/php/lib/php') in /home/www/jesica.php on line 3


모 예문을 들자면. 제가 제시카가 나오는 사진 페이지를 include로 불러오고 싶은데... 안불러 와지는겁니다. 이런식으로 오류를 내면서 ..순간 예전에 잘되던 기억이 났는데 왜 안될까.. 구글신께 또 문의를 드려봤습니다.

?
$a = file_get_contents("http://www.somedomain.com/file.php");
echo ($a);

?>


include로 안하고 file_get_contests로 하니까 되네요 ~ 또 다른 방법으로는

<?
require_once($_SERVER['DOCUMENT_ROOT'].'file.php');
?>


시스템 변수를 요구하지 않는 require_once를 사용하라는데 이건 제가 무슨말인지를 모르겠습니다;;

물론 제가 원문을 제대로 보았다면 - 저런 방법을 안사용하면 해커에 의해서 공격 소스가 첨부되어서 DDOS공격을 유발할수도 있다는것 같습니다 - 아 컴퓨터를 공부하기전에 먼저 영어를 공부하던지 해야지 ㅠㅠ

구글신의 도움으로 해결한 또다른 한편의 드라마 정도 되겠습니다...

만약 저의 난해한 글이 이상하시다면 , 위의 우월한 제시카를 보시면서 바다같은 마음으로 노여움을 풀어주세요..



출처 : http://blog.everymanhosting.com/php-coding/warning-include-functioninclude-url-file-access-is-disabled-in-the-server-configuration/comment-page-1/#comment-90


이글은 http://redeyesofangel.blogspot.com/2010/07/warning-include-functioninclude-url.html 으로 동시발행됩니다.