rlerdorf / geoip

PHP geoip ext for PHP 8
Other
16 stars 3 forks source link

Installation Manual #2

Open kenokallinger opened 2 years ago

kenokallinger commented 2 years ago

Do you have any guide on how to install this and use it with the roundcube-geolocation plugin? Thank you very much

plutocrat commented 1 year ago

In case it helps, this worked for me.

apt install php8.1-dev
git clone https://github.com/rlerdorf/geoip.git
apt-get install libgeoip-dev
cd geoip/
phpize8.1
./configure 
make 
make install
# Insert extension=geoip.so into php.ini
systemctl restart php8.1-fpm
systemctl restart nginx
svpven commented 1 year ago

Please, help with Windows 10/11 build steps for php 8.2, thanks!

C:\PHP-SDK\PHPMASTER\VS17\X64 +---deps ¦ +---bin ¦ ¦ GeoIP.dll ¦ ¦ geoiplookup.exe ¦ +---include ¦ ¦ GeoIP.h ¦ ¦ GeoIPCity.h ¦ ¦ GeoIP_internal.h ¦ +---lib ¦ GeoIP.lib ¦ libGeoIP.lib +---php-src ... +---ext ... ¦ +---geoip ¦ ¦ ¦ ChangeLog ¦ ¦ ¦ config.m4 ¦ ¦ ¦ config.w32 ¦ ¦ ¦ geoip.c ¦ ¦ ¦ geoip.stub.php ¦ ¦ ¦ geoip_arginfo.h ¦ ¦ ¦ LICENSE ¦ ¦ ¦ php_geoip.h ¦ ¦ ¦ README.md ¦ ¦ +---tests ¦ ¦ 001.phpt ¦ ¦ 002.phpt ¦ ¦ 003.phpt ¦ ¦ 004.phpt ¦ ¦ 005.phpt ¦ ¦ 006.phpt ¦ ¦ 007.phpt ¦ ¦ 008.phpt ¦ ¦ 009.phpt ¦ ¦ 010.phpt ¦ ¦ 011.phpt ¦ ¦ 013.phpt ¦ ¦ 014.phpt ¦ ¦ 015.phpt ¦ ¦ 016.phpt ¦ ¦ 017.phpt ¦ ¦ 018.phpt ¦ ¦ 019.phpt ¦ ¦ 020.phpt ¦ ¦ 021.phpt ...

... configure --with-geoip=shared --disable-zts (OK) nmake (ERRORS) ...

rc /nologo  /I . /I main /I Zend /I TSRM /I ext /n /fo C:\php-sdk\phpmaster\vs17\x64\php-src\x64\Release\php_geoip.dll.res /d FILE_DESCRIPTION="\"php_geoip.dll\"" /d FILE_NAME="\"php_geoip.dll\"" /d URL="\"https://www.php.net\"" /d INTERNAL_NAME="\"GEOIP extension\"" /d THANKS_GUYS="\"\"" win32\build\template.rc
"link.exe" @"C:\php-sdk\phpmaster\vs17\x64\php-src\x64\Release\resp\GEOIP_GLOBAL_OBJS.txt" C:\php-sdk\phpmaster\vs17\x64\php-src\x64\Release\php8.lib GeoIP.lib kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib Dnsapi.lib psapi.lib bcrypt.lib C:\php-sdk\phpmaster\vs17\x64\php-src\x64\Release\php_geoip.dll.res /out:C:\php-sdk\phpmaster\vs17\x64\php-src\x64\Release\php_geoip.dll /dll /nologo /GUARD:CF /d2:-AllowCompatibleILVersions /libpath:"C:\php-sdk\phpmaster\vs17\x64\deps\lib" /NXCOMPAT /DYNAMICBASE /libpath:"..\deps\lib"

Creating library C:\php-sdk\phpmaster\vs17\x64\php-src\x64\Release\php_geoip.lib and object C:\php-sdk\phpmaster\vs17\x64\php-src\x64\Release\php_geoip.exp

geoip.obj : error LNK2019: unresolved external symbol GeoIP_time_zone_by_country_and_region referenced in function zif_geoip_time_zone_by_country_and_region@@16

geoip.obj : error LNK2019: unresolved external symbol GeoIPDBFileName referenced in function zif_geoip_database_info@@16

geoip.obj : error LNK2019: unresolved external symbol GeoIPDBDescription referenced in function zif_geoip_db_get_all_info@@16

geoip.obj : error LNK2019: unresolved external symbol GeoIP_country_continent referenced in function zif_geoip_continent_code_by_name@@16

C:\php-sdk\phpmaster\vs17\x64\php-src\x64\Release\php_geoip.dll : fatal error LNK1120: 4 unresolved externals

clind922 commented 11 months ago

@svpven Did you manage to resolve your problem? I have encountered the very same error!