Page 1 of 1

browscap ini directive not set

PostPosted: Sun Feb 14, 2021 2:45 pm
by dspaan
Our apache error log is getting spammed with this warning.

Code: Select all
[Sat Feb 13 15:04:45.513412 2021] [php7:warn] [pid 2201] [client xxxxxxx:58407] PHP Warning:  get_browser (): browscap ini directive not set in /srv/www/htdocs/viciphone/viciphone.php on line 75


Line 75:

Code: Select all
$log_string .= get_browser(null,true);


I tried uploading the file manually and enabling it in php.ini according to the instructions here:
https://stackoverflow.com/questions/203 ... ve-not-set

But the warning keeps appearing.
Only by commenting out this line in viciphone.php stops the warning.

Re: browscap ini directive not set

PostPosted: Sun Feb 14, 2021 7:22 pm
by carpenox
This is the section I have for debug logging:

Code: Select all
// Create the debug log string
$log_string = date("Y-m-d H:i:s");
$log_string .= "\t";
if (!empty($_SERVER['REMOTE_ADDR'])) {
        $log_string .= $_SERVER['REMOTE_ADDR'];
}
$log_string .= "\t";
$log_string .= $base_referring_url;
$log_string .= "\t";
if (!empty($_SERVER['HTTP_USER_AGENT'])) {
        $log_string .= $_SERVER['HTTP_USER_AGENT'];
}
$log_string .= "\t";
$log_string .= get_browser(null,true);
$log_string .= "\n";

if ( $debug_access_log ) {
        // log it
        file_put_contents( "debug/viciphone_access.log",$log_string,FILE_APPEND );
}