我正在stream_select
'http流上尝试fopen()
。但是,stream_select
一直给我这些错误,而选择失败。
Warning: stream_select(): cannot cast a filtered stream on this system
Warning: stream_select(): cannot cast a filtered stream on this system
Warning: stream_select(): cannot cast a filtered stream on this system
Warning: stream_select(): No stream arrays were passed
流创建如下:
$ctx = array(..) // valid context, data is returned ok.
$fh = fopen($url,'r',NULL,$ctx);
// Result: resource(70) of type (stream)
那么,究竟什么是过滤流,为什么http流被认为是这样,有什么方法可以绕过它? stream_select
的文档说“无法选择某些流,例如zlib”,但没有提及http。
修改:在与Google和PHP文档交谈后,我尝试从流中查询元数据以查看是否指定了任何过滤器,答案为否:没有{{1}元数据中的索引,表示此流是无过滤的。
filters