PHP Velho Oeste 2024

実行時設定

php.ini の設定により動作が変化します。

GeoIP 設定オプション
名前 デフォルト 変更可能 変更履歴
geoip.custom_directory "" INI_ALL

以下に設定ディレクティブに関する 簡単な説明を示します。

geoip.custom_directory string

デフォルトは空ですが、 ライブラリ中にコンパイルされているパスとは異なるパスに強制的に変更可能です。

add a note add a note

User Contributed Notes 2 notes

up
2
James
8 years ago
This page is unclear on exactly which MaxMind DB you need.

I found the answer here: http://h3x.no/2010/11/10/php-geoip-required-database-not-available-at-usrsharegeoipgeoip-dat

wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz

MaxMind may have changed their site recently to highlight a different format; if you look on http://dev.maxmind.com/geoip/geoip2/geolite2/ it links to a mmdb format file now.
up
1
sly_one at abv dot bg
6 years ago
For me, It was needed also GeoIPCity.dat and adding extension to php.ini "extension=geoip.so" at the end of [PHP] section.

So ..
$details = geoip_record_by_name($ip_addr);

var_dump($details);

Now It works! :)
To Top