Search code examples
phpinibrowscap

browscap.ini file and get_browser() aren't working


I removed the comment also from the php.ini in place of browscap but still it is not working.

php.ini configuration file

[browscap]
browscap = "/Applications/mamp/conf/php7.0.0/browscap.ini"

and my code

<?php
$bro=get_browser(null,true);
print_r($bro);
?>

Solution

  • Today I phased this problem.

    Just open the Applications/MAMP/bin/php/php7.1.1/conf/php.ini file and uncomment this line:

    [browscap]
    browscap = /Applications/MAMP/bin/php/browscap.ini
    

    And finally restart the MAMP. get_browser() function will work.

    Let me know if you solved this problem.