몇 가지 질문을하고 싶습니다.
웹 서버 (apache2/php/debian)와 PHP를 보안상의 이유로 open_basedir 옵션으로 구성했습니다.
file_get_contents()를 사용하여 URL에 액세스해야하지만 경고 : file_get_contents() : open_basedir 제한 사항이 적용됩니다.
PHP 구성을 확인했고 allow_url_fopen이 켜져 있습니다.
개발 서버 (우분투 10.10)에서는 제대로 작동하지만 debian (6.0 squeeze)에서는 제대로 작동하지 않습니다. 어떤 생각 ??
URL에 PHP Open_basedir 제한
의 php.ini :
Open_basedir = /var/securedir/:/var/www
allow_url_fopen = On
PHP 코드 :
PHP 버전 수호신 - 패치
예와 5.3.3-7 + squeeze7 인
$a = file_get_contents("http://www.php.net");
Warning: file_get_contents(): open_basedir restriction in effect.
또 다른 문제는 다음과 같습니다.
$b = file_get_contents("/var/securedir/file.xml")
Warning: file_get_contents(): open_basedir restriction in effect. File(/var/securedir/file.xml) is not within the allowed path(s): (/var/securedir/:/var/www)
예제를 보여줄 수 있습니까? –
PHP의 버전은 무엇입니까? https://bugs.php.net/bug.php?id=48603 – symcbean
수호신 패치가있는 5.3.3-7 + squeeze7 – EsteveBlanch