MaxMind GeoIP API:fseek()[function.fseek]:流不支持在geoip.inc中进行查找 [英] MaxMind GeoIP API: fseek() [function.fseek]: stream does not support seeking in geoip.inc

查看:146
本文介绍了MaxMind GeoIP API:fseek()[function.fseek]:流不支持在geoip.inc中进行查找的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在这样使用MaxMind的GeoIP服务:

I'm using MaxMind's GeoIP service as such:

<?php
    include("geoip/geoip.inc");
    include("geoip/geoipcity.inc");
    include('geoip/geoipregionvars.php');
    $gi = geoip_open("http://watchandrepeat.com/GeoLiteCity.dat", GEOIP_STANDARD);
?>

事实证明geopi_open API使用了fseek,并且在我的Web服务器上失败了:

It turns out that the geopi_open API uses fseek, and it is failing on my web server:

Warning: fseek() [function.fseek]: stream does not support seeking in /hsphere/local/home/yudaluz/watchandrepeat.com/geoip/geoip.inc on line 319

在撰写本文时,您可以在此处看到失败: http://watchandrepeat.com/indextest.php

As of this writing, you can see it failing here: http://watchandrepeat.com/indextest.php

我正在使用IxWebHosting,我问他们的客户支持是否可以在他们的apache服务器上打开流搜索,因为在我的本地主机上它可以正常工作.他们说: 很抱歉,但是无法在我们的共享服务器上启用该功能.我建议您使用我们的VPS或Cloud托管计划.您将能够根据需要配置自己的服务器."

I am using IxWebHosting, and I asked their customer support if it's possible to turn on stream seeking on their apache server, as it works just fine on my localhost. They said this: "I am sorry, but it is impossible to turn on such a function on our Shared Server. I would like to recommend you to use our VPS or Cloud hosting plans. You will be able to configure your own server as you wish."

有什么解决方法吗?

推荐答案

摘录自 PHP手册:

"并非所有流都支持搜索.对于那些不支持的人 寻找,从当前位置向前寻找是由 读取和丢弃数据;其他形式的搜索将失败."

"Not all streams support seeking. For those that do not support seeking, forward seeking from the current position is accomplished by reading and discarding data; other forms of seeking will fail."

HTTP是不支持搜索的流之一.这正是您的错误消息指出的内容,stream [HTTP] does not support seeking.将您的数据库视为本地数据库,并删除该URL,它应该可以工作.

HTTP is one of those streams that don't support seeking. That's exactly what your error message states, stream [HTTP] does not support seeking. Treat your database as local and get rid of the URL and it should work.

这篇关于MaxMind GeoIP API:fseek()[function.fseek]:流不支持在geoip.inc中进行查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆