PHP Geo IP Location : 확장설치

munilive
Written by munilive on (Updated: )

PHP에서 Geo IP Location 관련 함수를 사용하기 위해서는 Geo IP Location 모듈을 확장 설치 해야 한다. Geo IP 함수를 이용하면, 아이피 주소를 통하여 접속한 아이피의 지역 정보를 찾을 수 있다.

설치는 간단히 yum install GeoIP-devel 명령을 통해 설치 할 수 있고, /etc/php.ini에서 extension=geoip.so에 대하여 활성화만 해주면 된다.

자세한 내용은 PHP 공식사이트에서 확인 바란다.
http://docs.php.net/manual/en/intro.geoip.php

The GeoIP extension allows you to find the location of an IP address. City, State, Country, Longitude, Latitude, and other information as all, such as ISP and connection type can be obtained with the help of GeoIP.

  • GEOIP 관련 함수
    • geoip_continent_code_by_name: Get the two letter continent code
    • geoip_country_code_by_name: Get the two letter country code
    • geoip_country_code3_by_name: Get the three letter country code
    • geoip_country_name_by_name: Get the full country name
    • geoip_database_info: Get GeoIP Database information
    • geoip_db_avail: Determine if GeoIP Database is available
    • geoip_db_filename: Returns the filename of the corresponding GeoIP Database
    • geoip_db_get_all_info: Returns detailed information about all GeoIP database types
    • geoip_id_by_name: Get the Internet connection type
    • geoip_isp_by_name: Get the Internet Service Provider (ISP) name
    • geoip_org_by_name: Get the organization name
    • geoip_record_by_name: Returns the detailed City information found in the GeoIP Database
    • geoip_region_by_name: Get the country code and region
    • geoip_region_name_by_code: Returns the region name for some country and region code combo
    • geoip_time_zone_by_country_and_region: Returns the time zone for some country and region code combo

Comments

comments powered by Disqus