I have an IP location script that works fine when called outside of EE (output viewable here: http://www.psaudio.com/IPTEST/sample-IP2Location.php). It returns the IP address, the country code, and the country long name just fine. The IP is grabbed using the standard getenv() function, while the country code and country long name are taken from a BIN file. The BIN file is in the same directory as the script.
When I call the script within EE, the IP is detected just fine, but the BIN file fails to load (output viewable here: http://www.psaudio.com/ps/home/zz_test_ip/).
Here is how I'm calling the script from within EE:
Code: Select all
include("/home/psaudio/public_html/IPTEST/sample-IP2Location.php");Here is the function call (within the script I'm calling) that loads the BIN file:
Code: Select all
$ip = IP2Location_open("IP-COUNTRY.BIN", IP2LOCATION_STANDARD);Code: Select all
function IP2Location_open ($filename, $flags) {
$ip = new IP2Location;
$ip->flags = $flags;
$ip->filehandle = fopen($filename,"rb");
if ($ip->filehandle === false) {
echo FILEHANDLE_NULL . $filename . ".\n";;
return 0;
}
$ip = IP2Location_initialize($ip);
return $ip;
}Can anyone help?