{"id":253,"date":"2011-06-01T09:34:13","date_gmt":"2011-06-01T09:34:13","guid":{"rendered":"http:\/\/songoku.homelinux.com\/wordpress\/?p=253"},"modified":"2011-06-01T09:34:13","modified_gmt":"2011-06-01T09:34:13","slug":"install-geoip-on-php","status":"publish","type":"post","link":"https:\/\/ndk.sytes.net\/wordpress\/?p=253","title":{"rendered":"Install GeoIP on PHP"},"content":{"rendered":"<p>Hello,<\/p>\n<p>i had to check which country some visitors come from when visiting a website and i remembered that awstats (statistik tool) uses a plugin called GeoIP. But awstats is written in perl and i asked myself if the extension does not exist for php and guess what: it exists! Here is a small howto to install it on CentOS:<\/p>\n<p>I found GeoIP in a third-party repository named EPEL. Check <a href=\"http:\/\/wiki.centos.org\/AdditionalResources\/Repositories\" target=\"_blank\">here<\/a> if you want to now how to install the repository. So now to the installation:<\/p>\n<p><em># yum install gcc php-pear geoip geoip-devel<br \/>\n\t# pecl install geoip<\/em><\/p>\n<p>After that you only have to add following line to your php.ini or create geoip.ini in your php.d directory with following content:<\/p>\n<p>extension=geoip.so<\/p>\n<p>Now restart the webserver and you are good to go. Only one note left: geoip is compiled with your actual running php version, so if you upgrade it you have to recompile your geoip installation.<\/p>\n<p>more infors about the geoip functions can be found <a href=\"http:\/\/www.php.net\/manual\/en\/book.geoip.php\" target=\"_blank\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, i had to check which country some visitors come from when visiting a website and i remembered that awstats (statistik tool) uses a plugin called GeoIP. But awstats is written in perl and i asked myself if the extension does not exist for php and guess what: it exists! Here is a small howto [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-253","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=253"}],"version-history":[{"count":0,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/253\/revisions"}],"wp:attachment":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}