我可以从 php CLI 加载远程文件 (http):
php > print_r(getimagesize("http://www.google.ca/intl/en_ca/images/logo.gif"));
Array
(
[0] => 276
[1] => 110
[2] => 1
[3] => width="276" height="110"
[bits] => 8
[channels] => 3
[mime] => image/gif
)
但是,来自网络脚本的完全相同的代码给了我:
[Thu Sep 03 21:47:53 2009] [error] [client 127.0.0.1] PHP Warning: getimagesize() [<a ref='function.getimagesize'>function.getimagesize</a>]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /var/www/html/Whatsize/index.php on line 30
[Thu Sep 03 21:47:53 2009] [error] [client 127.0.0.1] PHP Warning: getimagesize(http://www.google.ca/intl/en_ca/images/logo.gif) [<a href='function.getimagesize'>function.getimagesize</a>]: failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /var/www/html/Whatsize/index.php on line 30
我是否必须更改 httpd.conf 中的某些内容才能允许远程文件访问?