note 104168 added to ref.geoip

From: Date: Sun, 29 May 2011 03:10:08 +0000
Subject: note 104168 added to ref.geoip
Groups: php.notes 
Request: Send a blank email to php-notes+get-180082@lists.php.net to get a copy of this message
If you're having trouble making the GeoIP PHP functions recognise the location of your GeoIP database, the following block of code will show you all the directories in which the PHP functions are looking... so you'll need to shift your files around to suit it: <?php print_r( geoip_db_get_all_info() ); ?> and it'll output an array of 13 or so elements, looking something like this: Array ( [1] => Array ( [available] => 1 [description] => GeoIP Country Edition [filename] => /usr/share/GeoIP/GeoIP.dat ) [2] => Array ( [available] => 1 [description] => GeoIP City Edition, Rev 1 [filename] => /usr/share/GeoIP/GeoIPCity.dat ) [3] => Array ( [available] => [description] => GeoIP Region Edition, Rev 1 [filename] => /usr/share/GeoIP/GeoIPRegion.dat ) .. and so on. "available" will be 1 when the GeoIP file has been found and loaded. NOTE: if you download the GeoLiteCity.dat.gz file from MaxMind, just decompress it and rename it to GeoIPCity.dat and use the GEOIP_CITY_EDITION_REV1 constant and it'll work fine in PHP. ---- Server IP: 69.147.83.197 Probable Submitter: 60.242.250.155 ---- Manual Page -- http://www.php.net/manual/en/ref.geoip.php Edit -- https://master.php.net/note/edit/104168 Del: integrated -- https://master.php.net/note/delete/104168/integrated Del: useless -- https://master.php.net/note/delete/104168/useless Del: bad code -- https://master.php.net/note/delete/104168/bad+code Del: spam -- https://master.php.net/note/delete/104168/spam Del: non-english -- https://master.php.net/note/delete/104168/non-english Del: in docs -- https://master.php.net/note/delete/104168/in+docs Del: other reasons-- https://master.php.net/note/delete/104168 Reject -- https://master.php.net/note/reject/104168 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#180082) next »