Reputation: 11
My website used to work perfectly fine a few months ago. However, since changing host last month some parts of my website no longer work.
I am very sure the issue is related to GeoIP. My website requires the GeoIP php extension for it to work correctly. Both the old and new server have this extension enabled.
I get the following errors on my new server. Please note that the file "pdf_after_checkout_generator" is a custom made plugin.
PHP Warning: include(/usr/share/GeoIP/geoip.inc): failed to open stream: No such file or directory in /home/jksastrology/public_html/wp-content/plugins/pdf-after-checkout-generator/pdf_after_checkout_generator.php on line 18
PHP Warning: include(): Failed opening '/usr/share/GeoIP/geoip.inc' for inclusion (include_path='.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in /home/jksastrology/public_html/wp-content/plugins/pdf-after-checkout-generator/pdf_after_checkout_generator.php on line 18
PHP Fatal error: Call to undefined function geoip_open() in /home/jksastrology/public_html/wp-content/plugins/pdf-after-checkout-generator/pdf_after_checkout_generator.php on line 20
I contacted my current host about this issue. I asked them what the file path is for the GeoIP extension on their server. They provided the following response (see bottom of post).
I would appreciate answers to the following questions:
I am not sure how to implement a solution. They are saying the file my website requires is not in their GeoIP extension file. Does this mean I need to install files (within the link they supplied) to my main wordpress site? then point my broken include code to the newly downloaded geoip.inc file?
I have no idea what this particular error is about. It is referencing PEAR, and I am not sure why.
PHP Warning: include(): Failed opening '/usr/share/GeoIP/geoip.inc' for inclusion (include_path='.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in /home/jksastrology/public_html/wp-content/plugins/pdf-after-checkout-generator/pdf_after_checkout_generator.php on line 18
Hi there,
This would vary depending on what package you have I suspect, the server I checked has the dat file (/usr/share/GeoIP/GeoIP.dat) present but there is no PHP include file there.
The simplest fix would be to move the PHP dependency into the code base of the application rather than relying on a globally shared version. We don't as a rule install things like this globally as if it was then updated and the API changed it would break everyone that depended on its code.
You would need to check the .inc file on the old server to confirm but this code is probably the code in this GIT repo so it would be simple enough to move in to the base application - https://github.com/maxmind/geoip-api-php
Upvotes: 1
Views: 559
Reputation: 31088
This has nothing to do with pear. The PEAR Net_GeoIP package has no geoip.inc
file.
I guess that you have to put the source code of https://github.com/maxmind/geoip-api-php/ into /usr/share/GeoIP/
directory.
Upvotes: 0