rlerdorf / geoip

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

errors during installation #4

Open mark-faulk opened 2 years ago

mark-faulk commented 2 years ago

I got errors while trying to install and I'm not sure what to do. I have Ubuntu 20.04 and php 8.1:

`$/usr/bin/phpize8.0 Configuring for: PHP Api Version: 20200930 Zend Module Api No: 20200930 Zend Extension Api No: 420200930

$ ./configure
checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for a sed that does not truncate output... /usr/bin/sed checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for cc... cc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether cc accepts -g... yes checking for cc option to accept ISO C89... none needed checking how to run the C preprocessor... cc -E checking for icc... no checking for suncc... no checking for system library directory... lib checking if compiler supports -Wl,-rpath,... yes checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking target system type... x86_64-pc-linux-gnu checking for PHP prefix... /usr checking for PHP includes... -I/usr/include/php/20210902 -I/usr/include/php/20210902/main -I/usr/include/php/20210902/TSRM -I/usr/include/php/20210902/Zend -I/usr/include/php/20210902/ext -I/usr/include/php/20210902/ext/date/lib checking for PHP extension directory... /usr/lib/php/20210902 checking for PHP installed headers prefix... /usr/include/php/20210902 checking if debug is enabled... no checking if zts is enabled... no checking for gawk... gawk checking for geoip support... yes, shared checking for geoip files in default path... not found configure: error: Please reinstall the geoip distribution`

How do I "reinstall the geoip distribution"? I ran:

$ sudo apt-cache search geoip

and there was no package called "geoip", but there were a lot of others that contained "geoip" in the title.

Here's what I currently have that contains "geoip":

`$ sudo apt list --installed | grep geoip

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

geoip-database/focal,focal,now 20191224-2 all [installed,automatic] libgeoip1/focal,now 1.6.12-6build1 amd64 [installed,automatic] libnginx-mod-http-geoip/focal,now 1.23.0-1+ubuntu20.04.1+deb.sury.org+1 amd64 [installed,automatic] libnginx-mod-stream-geoip/focal,now 1.23.0-1+ubuntu20.04.1+deb.sury.org+1 amd64 [installed,automatic] php-geoip/focal,now 1.1.1+repack1-1+ubuntu20.04.1+deb.sury.org+3 amd64 [installed] php7.3-geoip/focal,now 1.1.1+repack1-1+ubuntu20.04.1+deb.sury.org+3 amd64 [installed] php7.4-geoip/focal,now 1.1.1+repack1-1+ubuntu20.04.1+deb.sury.org+3 amd64 [installed,automatic]`

kissit commented 2 years ago

@mark-faulk The build works just fine for me on Ubuntu 20.04 & PHP 8.1 with these packages installed prior to building:

apt-get install geoip-bin geoip-database libgeoip-dev

FWIW, you probably only need the last one, but I was installing on a fresh system so installed all 3.

plutocrat commented 1 year ago

My install notes in case this helps anyone

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