Using GeoIP with PHP - Part 4

It was a fruitful journey trying to install the GeoIP extension. These are some lessons learned from all three previous posts.

If you’re running Ubuntu in live production server, stick to Long Term Support (LTS) distro. Be very conservative, similar to RPM-based distro. Use CentOs and not Fedora for production.

Do not trust the stability of the extension that came bundled from the distro. Ubuntu/Debian always a bit lag behind with the latest fixes. Install your PHP extension using PECL.

Always test your installed PHP extension using the test cases that came together in the source code. The greatest benefit is all these test cases will show the stability of the extension and the correctness of your PHP configuration. Starting from now, any new LAMP installation will be tested with the sample test cases in the PHP source.

Read the bloody changelog. Google the proper keywords. It never occurs to me to google the culprit method name, geoip_db_get_all_info().

Learn some C and how to debug with gdb. I still don’t quite understand C and can’t really backtrace the issue back to the original line of the code. Something to improve upon in the coming future.

I have been using PHP professionally for many years and yet there are still a lot to be learned.

No comments:

Post a Comment