chrislim2888 / IP2Location-PHP-Module

This module is a PHP module that enables the user to find the country, region, city, coordinates, zip code, ISP, domain name, timezone, connection speed, IDD code, area code, weather station code, weather station name, mobile, usage types, address type, IAB category, etc that any IP address or host name originates from.
https://www.ip2location.com
MIT License
197 stars 69 forks source link

Bin file - error line 400 of ip2location.php #10

Closed pascalf22 closed 8 years ago

pascalf22 commented 8 years ago

Hello support team,

I tried to get info with binary file ! But the php script stop because i receive an error i receive this error in my server logs

PHP Parse error: syntax error, unexpected '[' in /home/mywebsite/public_html/ip2location/IP2Location.php on line 400

This error is in your file when i call the require_one 'ip2location/IP2Location.php';

require_once 'ip2location/IP2Location.php'; <---- code stop after this line because the error is at line 400
$db = new \IP2Location\Database('./ip2location/databases/IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE.BIN', \IP2Location\Database::FILE_IO);

What version of php should i have ? Do you have an idea for how fix this ?

Thanks a lot !

Pascal

chrislim2888 commented 8 years ago

I have tested the DB5 BIN data file and found no problem on that. Can you please re-download the latest version for testing again?

Btw, we tested using the PHP 5.5 and later.