![]() |
GeoIP not working?
Hello, I can't seem to get GeoIP working properly for use with scripts on my server.
Basically, I've enabled the IP GeoLocation in LS, at server level, and provided the .dat for it. I've also enabled it at VHOST level, and added a GeoIPEnable On directive to the relevant htaccess. However, scripts cannot use functions, such as -Call to undefined function- geoip_database_info(). PHPInfo shows that _SERVER[GEOIP_*] (4 entries) and it's accurate, but I can't seem to get scripts to use the functions. Any ideas? |
You need to add geoip support (download & install pecl geoip, load geoip.so to lsphp5 ) to lsphp5.
|
Hello webizen, how do I do this?
|
Here is the procedure:
|
Thanks webizen!
|
Webizen, when I try to use some functions, as in the code below,
PHP Code:
|
Here is what GeoIP can do in LSWS (http://www.maxmind.com/http://www.li...read.php?t=830)
Quote:
You are trying to use GeoIP functions (http://www.php.net/manual/en/ref.geoip.php) in PHP which is outside of LSWS. That's why suggestion to add geoip support in lsphp5 is provided. Looks like your GeoDB data file isn't not in the right place. Hence the problem. Copy the GeoIP data file to /usr/share/GeoIP directory to let PHP GeoIP extension pick them up (http://www.php.net/manual/en/geoip.setup.php). Once done, you can verify which database is available in your system with a script like the following: PHP Code:
|
Hello webizen,
Thank you very much for the details - it is much appreciated. Below's a copy of the output: Quote:
|
Quote:
|
As the note(b) indicates, you need to check the prefix of your running lsphp5.
Quote:
|
| All times are GMT -7. The time now is 09:56 PM. |