PHP/Browscap not working: get_browser(): browscap ini directive not set

65 views Asked by At

I'm trying to use browscap on my php shared hosting to analyze my logs and I get the following error message:

get_browser(): browscap ini directive not set ... etc ...

I installed browscap through ssl with:

composer require browscap/browscap-php 

Then:

vendor/bin/browscap-php browscap:fetch
vendor/bin/browscap-php browscap:convert 

I got the message:

write fetched file to /home/xxx/vendor/browscap/browscap-php/resources/browscap.ini

When I checked the resources directory, I could only see a empty file called .gitkeep I downloaded manually the php_browscap.ini file and transferred it into the resource directory to compensate what was not done in the previous step.

Then I created a .user.ini file in the directory where I want to parse my logs and added the following line to the file

[browscap] browscap = "/home/xxx/vendor/browscap/browscap-php/resources/php_browscap.ini"

I don't have access to the php.ini but my hosting company offers the possibility to have a personalized ini file for that kind of purpose.

Despite what I have done, I still get the error message indicating that get_browser() is not supported.

Did I miss something? Or is it simply not possible on shared hosting?

Thanks

0

There are 0 answers