Installing GeoIP extension in Zend Server 5.6 on Windows

July 31, 2013
by deddu

To test if you have php_geoip extension on your Zend Server, create an php file and copy the following code. This will output true if extension is available or false if not.

<?php 
var_dump(function_exists('geoip_database_info'));

If your output is false than you have to download an php_geoip.dll file correctly compiled for your zend server version.

For Zend Server 5.6 you can find geoip extension here:

http://windows.php.net/downloads/pecl/releases/geoip/1.0.8/

As you can see there are several files for different architectures and compilers

** NOTE: you can find on what architecture your php is built and the compiler used with phpinfo();

Compiler MSVC9 (Visual C++ 2008)
Architecture x86

After you have downloaded the php_geoip.dll you have to copy the file in:

C:\YOUR_LOCATION\Zend\ZendServer\lib\phpext\

Now you have to go in your Zend Server interface, restart php, turn on geoip extension from Server Setup -> Extension and restart php again.

If you get an error loading geoip extension than you picked the wrong dll and you have to try the other ones.

Otherwise your geoip extension is loaded and your test script from the beginning will output “true”.

The next step is to download some geoip databases from maxmind.

  • geoIP.dat
  • geoIPCity.dat
  • geoIPOrganization.dat
  • or anything you need

Copy those .dat files in

C:\YOUR_LOCATION\Zend\ZendServer\bin\

And now you can use geoip functions on your Zend Server 5.6

This entry was posted in Best Practice, DotKernel, PHP Development. Bookmark the permalink.

One Response to Installing GeoIP extension in Zend Server 5.6 on Windows

  1. Pingback: Installing GeoIP extension in Zend Server 6 on Windows | DotKernel PHP Application Framework

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>