I've just noticed that cron on one of our servers which has just been upgraded to Ubuntu 12.04LTS is having an issue with the browscap.ini file.
Every half an hour it runs a command along the lines of:
[ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete
(which may be truncated, but the command isn't the problem, because a simple "php -v" results in the same problem). The result is that I'm getting emails telling me:
PHP: syntax error, unexpected $end, expecting ']' in /etc/php5/cli/conf.d/full_php_browscap.ini on line 63
if I view line 63, it's:
[Mozilla/?.0 (compatible\\; Ask Jeeves/Teoma*)]
I've looked for different versions of the file, and I see in some others the line doesn't contain the escape characters (\\) before the semicolon, which can cause problems, but the solution for that seems to be to insert the escape characters.
My version of the file is:
[GJK_Browscap_Version]
Version=5015
Released=Fri, 31 Aug 2012 17:50:21 -0000
which is the latest one I can find, since the project went into a restart.
The version of PHP installed on the system is:
PHP 5.3.10-1ubuntu3.4 with Suhosin-Patch (cli) (built: Sep 12 2012 18:59:41)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
Does anyone have any suggestions on how to fix this, to remove the error, other than removing the file?
Thanks,
Simon
It seems the problem was the use of the \\;, instead of \;
I changed them all with the following command:
sed -i 's:\\\\;:\\;:g' full_php_browscap.ini
and php no longer complains.
Thanks.
Hey
Which browscap library are you using?
Also are you using the PHP browscap version, or the ASP version?
Thanks
James
--
You received this message because you are subscribed to the Google Groups "browscap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to browscap+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi James and thank you for response, i'm using this PHP browscap version : http://browscap.org/stream?q=PHP_BrowsCapINI
I'm using the version 6000 of the library, released Thuesday, 12 March 2015.
I'm use my own library/methode since 2009, she sort the INI file with the PHP base fonction named "parse_ini_file()". When i passed to PHP 5.3, this fonction get an new argument/mode of fonctionnement who generate a Warning when i run the code... =/