Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7939115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:00:08+00:00 2026-06-03T23:00:08+00:00

– Running PHP 5.3.8 on Linux- To start, we have solved this issue to

  • 0

– Running PHP 5.3.8 on Linux-

To start, we have solved this issue to the point where the function returns the expected values. However there are still a lot of unanswered questions I’ve got, and the “solution” is more of a hack-around than anything.

I’ve spent the better part of a day on this issue, so bear with me as I explain what was done. To start, the issue is that the return value of get_browser() is FALSE, which is not a documented return value. This leads me to assume that FALSE being returned means some sort of error state within the function.

The test code, after many iterations, became just a simple var_dump(get_browser($agent, true)). I ran tests with both passing the user agent string directly, as well as passing no arguments, e.g. var_dump(get_browser()), that all had the same return values.

What was tried/verified, with no change in return value:

browscap.ini:

  • Have the latest version, also tested a few previous versions

Permissions:

  • bowscap.ini – Initial permissions were 644, but I have tried everything from 644-777

  • Directory containing browscap.ini – Initial permissions were 755, tried 777 as well

  • Verified that PHP can access the file and directory with other functions like file()

User Agent

  • Tried passing a manual user agent string

  • Tried passing $_SERVER[‘HTTP_USER_AGENT’]

  • Verified my user agent string with a friend in a far away land – get_browser() returned values as expected.

php.ini

  • The browscap setting points to the correct location

  • verified again with echo count(file(ini_get('browscap')));

Error Logs

  • Checked PHP & Apache error logs for any mention of ‘browscap’ or anything even closely related – nothing out of the ordinary.

File Structure

This is where I suspect that the error comes from. browscap.ini lives in /var/php/, which has suitable permissions as noted above. My thought was that maybe PHP couldn’t access this directory, or something along those lines. However, this directory is also where sessions are stored, so that becomes less likely.

THE “SOLUTION”

What solved the issue was moving browscap.ini to the public web directory. I’m curious as to why this is the case, especially given the undocumented return value. The “solution” works, but is not the solution I thought I would find…

Does get_browser() have special permissions requirements, or anything like that? file() could access the directory and file just fine, but get_browser() could not (presumably). I’ve practically pulled my hair out over this issue and would love some resolution!

Thanks for reading!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T23:00:10+00:00Added an answer on June 3, 2026 at 11:00 pm

    Actually, even not documented on the manual page, the get_browser function can return FALSE for multiple reasons.

    At least a look into the underlying source code let one assume that.

    I suggest you take a look in there and then let me know if you have additional questions. I might be able to answer them then.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this code: <?php $valid_ext = array(pdf, doc); $args = array( 'post_type' =>
So to start, I have an array of XML files. These files need to
My NSXMLParser breaks on this string: <title>AAA &#8211; BCDEFGQWERTYUIO</title> I parsed it in this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a PHP application that stores PHP datetime to my MySQL table. I
I would like to count the length of a string with PHP. The string
I've got the following login script.. <?php $name = $_POST[name]; $password = $_POST[password]; $query
Have a webpage that will be viewed by mainly IE users, so CSS3 is
I have a simple restful service that transforms a JAXB-anntotated beans to response XML
i have a text file with the following data: Calculated Concentrations 30.55 73.48 298.25

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.