Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should I be setting browscap.ini file

Tags:

I downloaded the browscap.ini file and then pasted it to the directory "C:\wamp\bin\php\php5.4.3\extras" and i went to php.ini file and made these changes there:

[browscap] ; http://php.net/browscap browscap = extras/browscap.ini 

and then i restarted the server, and typed the following code into temp.php file:

<?php echo $_SERVER['HTTP_USER_AGENT'] . "<br><br>";  $browser = get_browser(null, true); print_r($browser); ?> 

now the output is like:

Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4  Warning: get_browser(): browscap ini directive not set in C:\wamp\www\functions\browser.php on line 4 

am i missing something? please provide some solution, and sorry if i am unable to make you understand

like image 790
Nicholas Wild Avatar asked Sep 30 '12 17:09

Nicholas Wild


People also ask

What is Browscap INI file?

Browscap. ini is a file, introduced with Microsoft's IIS, that lists the User-Agent strings that different browsers send, and various capabilities of those browsers. This module parses browscap. ini and allows you to find the capability definitions for a given browser.

What is Browscap?

» Browscap is an open project dedicated to collecting an disseminating a "database" of browser capabilities -- actually a set of different files describing browser capablities. PHP has built-in support for using these files via the » get_browser() function.


1 Answers

You are to use the Full PATH and restart your server when you are done

Example

[browscap] ; http://php.net/browscap browscap = "C:\xampp\php\extras\browscap.ini" 
like image 163
Baba Avatar answered Sep 21 '22 09:09

Baba