ID:               19393
 Comment by:       brett dot jr dot alton at gmail dot com
 Reported By:      philippe at pyf-labs dot com
 Status:           No Feedback
 Bug Type:         PHP options/info functions
 Operating System: Suse Linux 8.0
 PHP Version:      4.2.1
 New Comment:

I'm now running this script:

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

and it only returns:

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20071008
Ubuntu/7.10 (gutsy) Firefox/2.0.0.6

with no array.

My server is running PHP 5.2.1, Apache 2.2.3 and my browscap.ini file
is in '/etc/php5/apache2/extra/browscap.ini'. The file I am using is
from http://browsers.garykeith.com/downloads.asp called
'php_browscap.ini'.

Yes, I renamed the file to 'browscap.ini' in the
'/etc/php5/apache2/php.ini' file.


Previous Comments:
------------------------------------------------------------------------

[2002-10-08 21:47:04] [EMAIL PROTECTED]

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.



------------------------------------------------------------------------

[2002-09-17 22:12:16] [EMAIL PROTECTED]

Check your Apache's error log for error messages pertaining to PHP's
ability to parse browscap.ini, these errors would only occur on Apache
start.
Since php's browscap.ini parser will stop parsing the file if it
encounters an error, the effect is the same as not having a browscap.ini
in the first place.
The solution in this case would be to either fix the lines PHP's parser
complains about or remove them from the file all together.

------------------------------------------------------------------------

[2002-09-13 11:40:46] philippe at pyf-labs dot com

Hi Gurus !

(Running PHP 4.2.1 with a Apache/1.3.26 server installed from the Suse
Linux 8.0 disks).

Using the following script found in the documentation :

<?php
function list_array ($array) {
    while (list ($key, $value) = each ($array)) {
    $str .= "<b>$key:</b> $value<br>\n";
    }
    return $str;
}
echo "$HTTP_USER_AGENT<hr>\n";
$browser = get_browser();
echo list_array ((array) $browser);
?>

I only get the $HTTP_USER_AGENT value and nothing more, the
get_browser() function returns FALSE.

My php.ini file point to the browscap.ini file. This is confirmed by
executing phpinfo()

Looking at the bug history I saw that this seems to be a recurent
problem. Anything you can do ?

Thanks !

Philippe

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=19393&edit=1

Reply via email to