Jump to content

Error with get_browser();


Thierry

Recommended Posts

I'm having trouble with get_browser(), returning the error:

 

"Warning: get_browser(): browscap ini directive not set."

 

I've looked it up and it turns out I didnt have a browscap.ini file and link to it in php.ini

I've gotten a browscap.ini file now and I put it in the php root folder (same folder as php.ini), and I've tried various URLs but the function still wont work.

 

I've tried: "browscap.ini, /php/browscap.ini/, D:/folder1/folder2/folderetc/php/browscap.ini/ and more but none seem to work"

And yes, I've removed the ';' so it should be active.

Link to comment
https://forums.phpfreaks.com/topic/58928-error-with-get_browser/
Share on other sites

I guess the solution to your problem depends on which OS you use... if you are using windows try using \ (backslahes) instead of / (slashes):

 

D:\folder1\folder2\folderetc\php\browscap.ini

 

The path must be absolute I think, so you have to include the whole path.

 

But before you try that, try remove the trailing slash... it should be ...php\browscap.ini and not ..php\browscap.ini\. The trailing slash indicates that you are pointing at a directory and not a file :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.