This is probably pretty obvious. I ran through the maxmind documentation to install geoip via Composer.
It is installed now and the directories are created. when trying to add the script to my php file I get the following error:
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'The file "/usr/local/share/GeoIP/GeoIP2-City.mmdb" does not exist or is not readable.' in /home/mysite/mysite.com/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php:48 Stack trace: #0 /home/mysite/mysite.com/vendor/geoip2/geoip2/src/Database/Reader.php(53): MaxMind\Db\Reader->__construct('/usr/local/shar...') #1 /home/mysite/mysite.com/shopping_carttest.php(26): GeoIp2\Database\Reader->__construct('/usr/local/shar...') #2 {main} thrown in /home/mysite/mysite.com/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php on line 48
This is the code in the php file:
/maxmind geoip
require 'vendor/autoload.php';
use GeoIp2\Database\Reader;
// This creates the Reader object, which should be reused across
// lookups.
$reader = new Reader('/usr/local/share/GeoIP/GeoIP2-City.mmdb');
// Replace "city" with the appropriate method for your database, e.g.,
// "country".
$record = $reader->country('128.101.101.101');
Obviously the file location is not finding that database file. During the install procedure I am not sure if that database file was added anywhere. I am not sure if the file was added during the composer install or if I need to manually add it? And if it was added during the composer install where it was created.