没有设置browscap ini指令 [英] browscap ini directive not set

查看:167
本文介绍了没有设置browscap ini指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 get_browser()函数试图警告人们他们的浏览器不支持Javascript。实际上我正在用它来告诉他们他们可以使用我正在构建的Web应用程序的某些部分。我已经决定正确使用Javascript,因为我已经厌倦了听害怕使用它的开发人员而且我已经看到了该语言的一些巨大潜力。我离题了,这是错误。

I'm using the get_browser() function in an attempt to warn people that their browser doesn't support Javascript. Actually I'm using it to tell them they can use certain parts of a web application I'm building. I've decided to properly use Javascript because I'm tired of listening to developers that are scared of using it and I've seen some great potential in the language. I digress, here is the error.


browscap ini指令未设置

browscap ini directive not set

现在我想象这意味着我需要把它设置为php.ini。有人可以给我这方面的指示吗?

Now I'd imagine this means I need somthing set it the php.ini. Can someone give me some direction on this one?

推荐答案

我不认为这是检测的最佳解决方案是浏览器支持您的网站所需的内容:

I don't think this is the "best" solution to detect is a browser supports what you need for your website :


  • 首先,浏览器可以说谎 - 他们可以发送任何想要的内容 User-Agent


    • 即使给定版本的支持应该支持你需要的东西,Javascript仍然可以被禁用。

    对于第二点,您应该测试浏览器是否真正支持您所需要的 - 而不是依赖于诸如browscap one。

    For the second point, you should test if the browser actually supports what you need -- and not rely on a list such as the browscap one.



    仍然,回答你关于 browscap get_browser em>(引用):


    注意:为了实现这一点,您的< a href =http://php.net/manual/en/misc.configuration.php#ini.browscap =noreferrer> browscap php.ini中的配置
    设置必须指向系统上 browscap.ini
    文件的
    正确位置。 browscap.ini
    没有与PHP绑定,但你可能会发现
    是最新的»
    php_browscap.ini
    文件在这里。

    虽然 browscap.ini 包含许多浏览器的
    信息,但
    依靠用户更新来保留
    数据库当前。
    文件的格式相当不言自明。

    Note: In order for this to work, your browscap configuration setting in php.ini must point to the correct location of the browscap.ini file on your system. browscap.ini is not bundled with PHP, but you may find an up-to-date » php_browscap.ini file here.
    While browscap.ini contains information on many browsers, it relies on user updates to keep the database current. The format of the file is fairly self-explanatory.

    所以,你必须:


    • 下载browscap文件,

    • 并设置 browscap 指令在你的 php.ini 文件中,它指向你下载的文件。

    • download the browscap file,
    • and set the browscap directive in your php.ini file, so it points to the file you downloaded.

    这篇关于没有设置browscap ini指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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