用fopen打开远程文件形如:http://translate.google.com/translate_tts?tl=en&q=how%20do%20you%20do
fopen(path,'rb');apache服务器在Linux下。
对外网络访问一切正常。
php中allow_url_fopen参数为On
但是就是打不开远程文件,fopen返回空值。
我在windows下配置了同样的开发环境,同样的代码却能运行成功。难道Google对TTS的使用有特定的访问限制?各位大侠帮忙分析一下可能的原因吧!
fopen(path,'rb');apache服务器在Linux下。
对外网络访问一切正常。
php中allow_url_fopen参数为On
但是就是打不开远程文件,fopen返回空值。
我在windows下配置了同样的开发环境,同样的代码却能运行成功。难道Google对TTS的使用有特定的访问限制?各位大侠帮忙分析一下可能的原因吧!
$newfname = 'XXXXXXXX';
$remote_file = fopen($reqBaseURL, "rb");
if ($remote_file){
$newf = fopen($newfname, "wb");
if ($newf){
while(!feof($remote_file)){
$this->log('w','tmp');
fwrite($newf, fread($remote_file, 1024 * 8),1024 * 8);
}
}
}
if ($remote_file) {
fclose($remote_file);
}
if ($newf) {
fclose($newf);
}代码很简单的