Posted by anrikun on October 19, 2010 at 9:25am
6 followers
| Project: | GeoIP API |
| Version: | 6.x-1.4 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
For instance:Fatal error: Cannot redeclare geoip_country_code_by_name() in [...]/sites/all/modules/geoip/lib/geoip.inc on line 376
This happens when the geoip PECL extension is enabled on the server.
GeoIP API currently only supports the pure PHP lib that comes with the module and not the geoip PECL extension.
This is not stated on the project page nor in the INSTALL.txt.
Comments
#1
Cool, I had no idea there was a pecl extension. Ideally we'd make them compatible but they seem to have different enough interfaces that it might be tricky. We should document the incompatibility and probably do a warning in hook_requirements.
#2
By the way, I think that the pure PHP API (http://www.maxmind.com/download/geoip/api/php/) should not ship with the module (it is a 3rd party library) but be downloaded separately by user into
sites/all/libraries.This way, user could choose between using the pure PHP API or the PECL extension.
#3
Including their library doesn't preclude supporting the pecl library. It's an include that could be conditional. But I think you must have missed the part about them being totally different APIs. I'm open to patches that would add support but that would really be a feature request. The real bug here is the undocumented incompatibility.
#4
Sorry, I know this is a different issue. I was just too lazy to open a separate one :-)
#5
The ad_geoip module (http://drupal.org/project/ad_geoip) uses the PECL extension.
#6
When you use PHP's geoip extension, there is no need to use this Drupal module. Thus I have removed the module from our server. Completely breaking all sites that have this module enabled is quite critical.
#7
I created a small patch to allow usage of geoip even if the geoip-extension is loaded. Note this is only a workaround to get this running. The geoip-extension should be used by geoip if possible and the PHP-implementation should only be a fallback.
Even with the geoip-extension I see the need for this module, as it allows to integrate geoip better into Drupal. Not sure how far the current implementation goas here, but I like having a module to define the API Drupal uses...