Closed dark-rider closed 6 years ago
With installed PHAR PHP extension (and even my shared hoster has it), it's extremely simple to install GeoIP2: Just download the latest geoip2.phar
file from MaxMind's releases page on GitHub, copy it to your webspace and include it to your PHP scripts by require 'geoip2.phar';
. Then you can use the code as in MaxMind's examples. I don't understand why MaxMind strongly recommends using Composer which is much more complicated especially if you did not yet use Composer.
I am glad you figured out how to use the Phar. Composer is a more robust solution for managing dependencies, which is why we recommend it. You don't need to run it on your shared host; you can just upload the vendor
directory.
how can I find vendor diretory?
Hi @alipour66m,
We recommend installing using Composer which should create a vendor directory. Instructions can be found here: https://github.com/maxmind/GeoIP2-php#install-via-composer
I use GeoIP legacy database with PHP for years, without any trouble. Just ony little folder containing the following files, and that's it:
Then just a short PHP code to use:
Now you announce GeoIP2 to replace GeoIP (legacy) soon, which unfortunately is much more complicated for low-level PHP coders who have never heared of things like Composer, dependencies, PHAR and so on. I also have no dedicated web server nor SSH, but just a shared hosting account with PHP and an FTP account to upload files from my Windows PC to the webspace.
Could you publish a low level, very easy instruction how to make GeoIP2 running for dummies who have no idea of GitHub and who are not able to understand all the concepts behind?
Moreover: As I read in another posting, GeoIP2 is running significantly slower then legacy version, that's why you recommend the optional C plugin. Can this be installed on shared hosting accounts, and if so, how?