From the errors you're getting, you don't have a package available that matches your current PHP package. You have two choices. First, you can use the new PHP version (no compiled code necessary.) If you have composer already installed for your project, you can do this easily:
php composer.phar require geoip2/geoip2:~2.0
Or, second choice, install the original package from PECL. Assuming you have already installed the appropriate PEAR package, and have development tools available (e.g.
gcc) you can try these steps:
apt-get install libgeoip-dev pecl install geoip