PhantomJS 2返回错误9“由于平台策略,当前不允许后台请求”

PhantomJS 2返回错误9“由于平台策略,当前不允许后台请求”,phantomjs,qt5,Phantomjs,Qt5,我在我的webapp上使用PhantomJS 1.9和rasterise.js 我正在Mac 10.10.5上本地测试PhantomJS 2.0 $cmd = "phantomjs rasterize.js http://example.com/pdf doc.pdf 29.7cm*21cm" $proc=proc_open($cmd,array(0=>array('pipe','r'),1=>array('pipe','w'),2=>array('pipe','w')),$p

我在我的webapp上使用PhantomJS 1.9和rasterise.js

我正在Mac 10.10.5上本地测试PhantomJS 2.0

$cmd = "phantomjs rasterize.js http://example.com/pdf doc.pdf 29.7cm*21cm"
$proc=proc_open($cmd,array(0=>array('pipe','r'),1=>array('pipe','w'),2=>array('pipe','w')),$pipes);
$stdout=stream_get_contents($pipes[1]);
fclose($pipes[1]);
$stderr=stream_get_contents($pipes[2]);
fclose($pipes[2]);
$rtn=proc_close($proc);
print_r( array('stdout'=>$stdout,'stderr'=>$stderr,'return'=>$rtn));
它返回:

Array ( [stdout] => [stderr] => [return] => 9 ) 
根据,9错误对应于

QNetworkReply::BackgroundRequestNotAllowedError 9由于平台策略,当前不允许后台请求

如果我切换回PhantomJS 1.9.2,它可以正常工作

有线索吗


非常感谢

不,这是PhantomJS:cf示例文件夹中提供的代码。文档:这只是我示例代码中的一个输入错误。但我的实际代码是正确的,因为它在我使用PhantomJS 1.9时起作用