いくつか質問したいです。
セキュリティ上の理由から、web サーバー (apache2/php/debian) と PHP を open_basedir オプションで構成しています。
file_get_contents() を使用して URL にアクセスする必要がありますが、警告: file_get_contents(): open_basedir 制限が有効ですというエラーが表示されます。
PHPの設定を確認したところ、allow_url_fopenがオンになっています。
開発サーバー (ubuntu 10.10) では正しく動作しますが、debian (6.0 スクイーズ) では動作しません。何か案が ??
PHP のバージョンは 5.3.3-7+squeeze7 で、Suhosin-Patch が適用されています
。例:
php.ini:
Open_basedir = /var/securedir/:/var/www
allow_url_fopen = On
phpコード:
$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)