Posts Tagged ‘php’

IP to country conversion

October 18, 2010 1 comment

Though there are a lot of available solutions to tackle this problem but the one reside in the Google Code is the perfect one with simplicity and ease of use. Below is the work around to setup a test case; –

Explore the code:

Visit the project’s profile and read about the documentation.

Download the code;

Get the latest code from the repo and extract it to the root directory of the web server. Linux – /var/www/phpip2country Windows – C:\xampp\htdocs\phpip2country

Test the code:

Browse the directory in the browser. http://localhost/phpip2country/index.php

You need to upload the sql file which is actually a mapper for IP and Countries.


IP numerical Value: 2130706433
IP registry: IANA
IP assigned (Y-m-d H:i:s): 1983-01-01 05:00:00
IP country RIR (Regional Internet Registry) representation: ZZ
IP Country Abbreviation: ZZZ
IP country name: RESERVED
IP range: array (
‘FROM’ => ‘’,
‘TO’ => ‘’,
IP range numerical: array (
‘FROM’ => ‘2130706432’,
‘TO’ => ‘2147483647’,
full IP informations array: array (
‘IP_FROM’ => ‘2130706432’,
‘IP_TO’ => ‘2147483647’,
‘ASSIGNED’ => ‘410227200’,
‘CTRY’ => ‘ZZ’,
‘CNTRY’ => ‘ZZZ’,
‘IP_STR’ => ‘’,
‘IP_VALUE’ => 2130706433,
‘IP_FROM_STR’ => ‘’,
‘IP_TO_STR’ => ‘’,

Below is the output when the code has been set on a live server.

IP numerical Value: 1949969107
IP registry: APNIC
IP assigned (Y-m-d H:i:s): 2007-03-27 19:00:00
IP country RIR (Regional Internet Registry) representation: PK
IP Country Abbreviation: PAK
IP country name: PAKISTAN
IP range: array (
‘FROM’ => ‘’,
‘TO’ => ‘’,
IP range numerical: array (
‘FROM’ => ‘1949958144’,
‘TO’ => ‘1949990911’,
full IP informations array: array (
‘IP_FROM’ => ‘1949958144’,
‘IP_TO’ => ‘1949990911’,
‘ASSIGNED’ => ‘1175040000’,
‘CTRY’ => ‘PK’,
‘CNTRY’ => ‘PAK’,
‘IP_STR’ => ‘’,
‘IP_VALUE’ => 1949969107,
‘IP_FROM_STR’ => ‘’,
‘IP_TO_STR’ => ‘’,

Categories: Web Tools Tags: , ,

Zend Erroronicles

April 5, 2010 2 comments

Today we are going to list the couple of buys a noob has to face while getting started with the Zend framework;- The story while traveling to the Hello world 😉


Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/landmark_collector/public/index.php on line 11

Fatal error: require_once() [function.require]: Failed opening required ‘Zend/Loader.php’ (include_path=’/var/www/landmark_collector/application/../library:.:/usr/share/php:/usr/share/pear’) in /var/www/landmark_collector/public/index.php on line 11


Set the zend library path in the inlude_path for php


+ the following lines at the top of the file /var/www/website-name/application/bootstrap.php

define(“SITE_ROOT”, dirname($_SERVER[‘DOCUMENT_ROOT’]));


Notice: Zend_Loader::Zend_Loader::registerAutoload is deprecated as of 1.8.0 and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in /var/www/landmark_collector/library/Zend/Loader.php on line 258

Fatal error: Uncaught exception ‘Zend_Controller_Dispatcher_Exception’ with message ‘Invalid controller specified (error)’ in /var/www/landmark_collector/library/Zend/Controller/Dispatcher/Standard.php:242 Stack trace: #0 /var/www/landmark_collector/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 /var/www/landmark_collector/public/index.php(25): Zend_Controller_Front->dispatch() #2 {main} thrown in /var/www/landmark_collector/library/Zend/Controller/Dispatcher/Standard.php on line 242


Categories: Web Frameworks Tags: , , , ,
%d bloggers like this: