bbjae.blogg.se

Maxmind db reader
Maxmind db reader







maxmind db reader
  1. Maxmind db reader how to#
  2. Maxmind db reader install#
  3. Maxmind db reader code#
  4. Maxmind db reader download#

Now we can use git to clone the repository. Nothing else seemed to work.įirst, make sure Git is installed and do this: Instead I needed to use Git to clone the repository.

Maxmind db reader download#

It may be tempting to just download the Master.zip from Github but that did not work for me.

Maxmind db reader how to#

Note: For reference purposes This page details some directions on how to do this also Have no fear, you can just keep following along. (Remember I said this could be confusing?) The PHP C Extension requires the use of the C Library. You should want FAST Geo lookups too! 😉 III.

Maxmind db reader install#

So I’ll need to install the PHP C Extension. If you’re happy with slow Geo lookups you can stop here and skip to section VI.īut I want FAST Geo lookups.

Maxmind db reader code#

If you run the sample code now, Geo lookups should work and everything should be peachy. Here’s a screenshot of what you should see. This is where all of that stuff was installed to. You should now see there is a new directory called “vendor”. Trying the composer install command, it now works. – Installation request for geoip2/geoip2 0.6.* -> satisfiable by geoip2/geoip2.Ĭomposer is complaining that “bcmath” is not installed. – geoip2/geoip2 v0.6.0 requires maxmind-db/reader 0.3.* -> satisfiable by maxmind-db/reader. – maxmind-db/reader v0.3.0 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system. Your requirements could not be resolved to an installable set of packages. Installing dependencies (including require-dev) Loading composer repositories with package information If all goes well, Composer will grab all the stuff we need. Now, back in the shell, execute this command: Then type :wq ( That’s colon+w+q) To save the file. So back to the terminal: vi composer.json json file that tells Composer what we want to install. OK so now it’s time to use Composer to grab the geoip2 package. You can see I get the message “ Composer successfully installed to /root/composer.phar” - it’s telling me where it put this. (Whatever directory you’re currently in). This will download “composer.phar” to your working directory. So we’ll be using the instructions I found here:

maxmind db reader

To use Composer you first need to install it. Since we’ll be using our database with PHP, we’re going to be using the PHP API. The database is now installed, but we can’t really make any use of it until we install an API. Mv GeoLite2-City.mmdb /usr/local/share/GeoIP/ Being familiar with the command line is a good thing 😉 Note: Rather than blindly copying & pasting these lines, I encourage you to spend a moment to think about what you’re doing. Now that we’ve got the URL, we can use wget to download it to our server, unzip it, and move it to the proper directory. If you hover over the link, you can right-click and “Copy Link Location”. The database is a bit hard to find, but here is the download page. Note: For the purposes of this tutorial, my working directory will be “/root”. Open up your Putty SSH Client (see: “ Affiliate’s Guide to SSH – Part 1“) and login to your server. Installing the Databaseįirst up, let’s download the latest GeoLite2-City database. But some commands like “yum” will need to be changed. You’ll also probably be able to follow this guide on Ubuntu as well. They should work for other Centos versions. Note: These install instructions are for Centos 6.5 Final. (4) A feeling of warm satisfaction and accomplishment (3) The optional PHP C Extension installed (1) The latest GeoLite2-City db installed What’s in the boxĪt the end of this walk-through, you’ll have: To help you avoid the same issues, I decided to create this walk-through and note any problems you might have. Most of them were small, but some required a lot of searching and trying different things to figure out what was wrong. While going through this set up process myself, I ran into a handful of problems. Unfortunately, the documentation on how to get this set up from start to finish is still non-existent. But the new format also requires a different method of setup. This new format is supposed to be better/faster, etc. Since then, Maxmind has updated their database format to “GeoIP2”. Edit your project's composer.json file to require davispeixoto/maxmind-db-reader.A couple of years ago I posted “ Blazing Geo Lookups! How To Install Maxmind PHP Extension on Your Server” which detailed how to get the Maxmind’s GeoIP database setup on your server. Installationīegin by installing this package through Composer. This Laravel 4 package provides a simple interface for MaxMind DB Reader.









Maxmind db reader