php8.5
Home/ Manual/ geoip / functions/ geoip_setup_custom_directory

geoip_setup_custom_directory

PHP function Edit on GitHub ✎

(PECL geoip >= 1.1.0)

Set a custom directory for the GeoIP database

Description

geoip_setup_custom_directory(string $path): void

The geoip_setup_custom_directory() function will change the default directory of the GeoIP database. This is equivalent to changing geoip.custom_directory.

Parameters

path

The full path of where the GeoIP database is on disk.

Return Values

Void

Examples

A geoip_setup_custom_directory() example

This will change the GeoIP default database path.

php
<?php

geoip_setup_custom_directory('/some/other/path');

print geoip_db_filename(GEOIP_COUNTRY_EDITION);

?>

The above example will output:

output
/some/other/path/GeoIP.dat

Source: reference/geoip/functions/geoip-setup-custom-directory.xml · from the official PHP manual (php/doc-en)