Michael Legg

Well-Known Member
Mar 2, 2015
81
5
58
New Farm, Queensland, Australi
cPanel Access Level
Website Owner
I just installed the latest lite_php_browscap.ini on my PHP7.4 server and I'm getting the following error ...

PHP: syntax error, unexpected end of file, expecting ']' in /opt/cpanel/ea-php74/root/etc/php.d/lite_php_browscap.ini on line 2364

I would have assumed that these files would be failly well tested before being released, is there something else I have to do to get the server to parse is properly?
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
11,138
1,755
363
cPanel Access Level
Root Administrator
Hey there! Can you let me know how you installed that tool? I'm not seeing that available through any of the normal PHP extension installer methods on a standard cPanel server, so there may be custom work necessary to get this working.
 

Michael Legg

Well-Known Member
Mar 2, 2015
81
5
58
New Farm, Queensland, Australi
cPanel Access Level
Website Owner
The problem is that the browscap.ini files are full of lines like these ...

[Mozilla/5.0 (compatible; MSIE 9.0*; *Windows NT 5.1*Trident/5.0* 360Spider*]

Where the string contains a semi-colon which is interpreted as a comment, thus causing the closing "]" to not be found and therefore generating the error - " syntax error, unexpected end of file, expecting ']'"

I download the files from Browser Capabilities Project which I assume is the official source and they say they are current as of 10th Mar 2022

I can't be the only person in the world using these files, why isn't everyone having this problem?