<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://briansnelson.com/index.php?action=history&amp;feed=atom&amp;title=Install_GeoIP_for_Apache_and_PHP</id>
		<title>Install GeoIP for Apache and PHP - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://briansnelson.com/index.php?action=history&amp;feed=atom&amp;title=Install_GeoIP_for_Apache_and_PHP"/>
		<link rel="alternate" type="text/html" href="https://briansnelson.com/index.php?title=Install_GeoIP_for_Apache_and_PHP&amp;action=history"/>
		<updated>2026-06-04T07:10:12Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>https://briansnelson.com/index.php?title=Install_GeoIP_for_Apache_and_PHP&amp;diff=837&amp;oldid=prev</id>
		<title>Brian: /* Setting PHP to use the Data Files= */</title>
		<link rel="alternate" type="text/html" href="https://briansnelson.com/index.php?title=Install_GeoIP_for_Apache_and_PHP&amp;diff=837&amp;oldid=prev"/>
				<updated>2015-06-05T12:39:06Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Setting PHP to use the Data Files=&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 12:39, 5 June 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 29:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 29:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Then you will want to restart apache and/or php-fpm.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Then you will want to restart apache and/or php-fpm.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;====Setting PHP to use the Data Files&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/del&gt;====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;====Setting PHP to use the Data Files====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You will want to add the following line to /etc/php.d/geoip.ini&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You will want to add the following line to /etc/php.d/geoip.ini&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key briansne_wiki-wiki_:diff:version:1.11a:oldid:836:newid:837 --&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>https://briansnelson.com/index.php?title=Install_GeoIP_for_Apache_and_PHP&amp;diff=836&amp;oldid=prev</id>
		<title>Brian: Created page with &quot;==Install GeoIP for Apache and PHP/PHP-FPM on Centos==  GeoIP is a C library that enables the user to find the country that any IP address or hostname originates from. It uses...&quot;</title>
		<link rel="alternate" type="text/html" href="https://briansnelson.com/index.php?title=Install_GeoIP_for_Apache_and_PHP&amp;diff=836&amp;oldid=prev"/>
				<updated>2015-06-05T12:38:49Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Install GeoIP for Apache and PHP/PHP-FPM on Centos==  GeoIP is a C library that enables the user to find the country that any IP address or hostname originates from. It uses...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Install GeoIP for Apache and PHP/PHP-FPM on Centos==&lt;br /&gt;
&lt;br /&gt;
GeoIP is a C library that enables the user to find the country that any IP address or hostname originates from. It uses a file based database that is accurate as of February 2009. This database simply contains IP blocks as keys, and countries as values. This database should be more complete and accurate than using reverse DNS lookups.&lt;br /&gt;
&lt;br /&gt;
===Install GeoIP Data===&lt;br /&gt;
&lt;br /&gt;
The epel yum repo has the GeoIP Data&lt;br /&gt;
&lt;br /&gt;
 yum install GeoIP{,-devel}&lt;br /&gt;
&lt;br /&gt;
This will install the data files in /usr/share/GeoIP&lt;br /&gt;
&lt;br /&gt;
===Install GeoIP for Apache===&lt;br /&gt;
&lt;br /&gt;
The epel yum repo also has mod_geoip for apache&lt;br /&gt;
&lt;br /&gt;
 yum install mod_geoip&lt;br /&gt;
&lt;br /&gt;
Now to verify that it was installed run:&lt;br /&gt;
&lt;br /&gt;
 httpd -M | grep geoip&lt;br /&gt;
&lt;br /&gt;
===Install GeoIP for PHP/PHP-FPM===&lt;br /&gt;
&lt;br /&gt;
This is available via PECL&lt;br /&gt;
&lt;br /&gt;
 pecl install geoip &amp;amp;&amp;amp; echo 'extension = geoip.so' &amp;gt; /etc/php.d/geoip.ini&lt;br /&gt;
&lt;br /&gt;
Then you will want to restart apache and/or php-fpm.&lt;br /&gt;
&lt;br /&gt;
====Setting PHP to use the Data Files=====&lt;br /&gt;
&lt;br /&gt;
You will want to add the following line to /etc/php.d/geoip.ini&lt;br /&gt;
&lt;br /&gt;
 geoip.custom_directory=/usr/share/GeoIP/&lt;br /&gt;
&lt;br /&gt;
You can do this with the following command&lt;br /&gt;
&lt;br /&gt;
 echo 'geoip.custom_directory=/usr/share/GeoIP/' &amp;gt;&amp;gt; /etc/php.d/geoip.ini&lt;br /&gt;
&lt;br /&gt;
Now you have to restart apache and/or php-fpm.&lt;/div&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	</feed>