Because we made a C version, and we use PHP, we might as well throw together a PHP module, if you want one of those :) It uses the code from the C implementation, so any bugs in that - is also here ;)
There is a benchmark app. in the Pure PHP package, meant for this module.
Also note, that this does not contain a binary database.
See the readme for details on how to build - We're not very experienced in this, and the documentation (on our part) is lacking due to "real" work ;)
On the C3 server, it throws out around 59000 lookups per second. Not as good as the C version (PHP makes it very slow apparently), but still a LOT better than the pure PHP versions ;)
We have only tested this as a loadable module - Not statically built into php, so feedback please :) Oh, and also this is only tested with PHP 4!
ip2c-php-module-0.9.2.tar.bz2 - PHP Module bzip2'ed (12 KB)
ip2c-php-module-0.9.2.zip - PHP Module zipped (17 KB)
| Etomite encountered the following error while attempting to parse the requested resource: | |||
| « PHP Parse Error » | |||
| PHP error debug | |||
| Error: | mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) | ||
| Error type/ Nr.: | Warning - 2 | ||
| File: | /www/weirdsilence/weirdsilence.net/www/index.php | ||
| Line: | 118 | ||
| Line 118 source: | if(@!$this->rs = mysql_connect($this->dbConfig['host'], $this->dbConfig['user'], $this->dbConfig['pass'])) { | ||
| Parser timing | |||
| MySQL: | 0.0000 s s | (0 Requests) | |
| PHP: | 0.0308 s s | ||
| Total: | 0.0308 s s | ||