dstogov / php-ffi

PHP Foreign Function Interface
570 stars 32 forks source link

unable to configure: no libffi on ubuntu 18.04/php7.3 #20

Open yanggs07 opened 5 years ago

yanggs07 commented 5 years ago
ygs@proxy:~/php-ffi$ phpize
Configuring for:
PHP Api Version:         20180731
Zend Module Api No:      20180731
Zend Extension Api No:   320180731

ygs@proxy:~/php-ffi$ ./configure
... ...
checking for FFI support... yes, shared
checking for libffi in default path... not found
configure: error: Please reinstall the libffi distribution

ygs@proxy:~/php-ffi$ locate libffi
/snap/core/5897/usr/lib/x86_64-linux-gnu/libffi.so.6
/snap/core/5897/usr/lib/x86_64-linux-gnu/libffi.so.6.0.4
/snap/core/5897/usr/share/doc/libffi6
/snap/core/5897/usr/share/doc/libffi6/changelog.Debian.gz
/snap/core/5897/usr/share/doc/libffi6/copyright.gz
/snap/core/6034/usr/lib/x86_64-linux-gnu/libffi.so.6
/snap/core/6034/usr/lib/x86_64-linux-gnu/libffi.so.6.0.4
/snap/core/6034/usr/share/doc/libffi6
/snap/core/6034/usr/share/doc/libffi6/changelog.Debian.gz
/snap/core/6034/usr/share/doc/libffi6/copyright.gz
/snap/core/6130/usr/lib/x86_64-linux-gnu/libffi.so.6
/snap/core/6130/usr/lib/x86_64-linux-gnu/libffi.so.6.0.4
/snap/core/6130/usr/share/doc/libffi6
/snap/core/6130/usr/share/doc/libffi6/changelog.Debian.gz
/snap/core/6130/usr/share/doc/libffi6/copyright.gz
/usr/lib/x86_64-linux-gnu/libffi.so.6
/usr/lib/x86_64-linux-gnu/libffi.so.6.0.4
/usr/share/doc/libffi6
/usr/share/doc/libffi6/changelog.Debian.gz
/usr/share/doc/libffi6/copyright
/var/lib/dpkg/info/libffi6:amd64.list
/var/lib/dpkg/info/libffi6:amd64.md5sums
/var/lib/dpkg/info/libffi6:amd64.shlibs
/var/lib/dpkg/info/libffi6:amd64.symbols
/var/lib/dpkg/info/libffi6:amd64.triggers
ygs@proxy:~/php-ffi$
yanggs07 commented 5 years ago
ygs@proxy:~/php-ffi$ apt search libffi
Sorting... Done
Full Text Search... Done
libalt-alien-ffi-system-perl/bionic 0.14-1 all
  simplified alternative to Alien::FFI that uses system libffi

libffi-checklib-perl/bionic 0.18-1 all
  module to check availability of a library for FFI

libffi-dev/bionic,now 3.2.1-8 amd64 [installed]
  Foreign Function Interface library (development files)

libffi-platypus-perl/bionic 0.47-3 amd64
  module to create Perl bindings to non-Perl libraries with FFI

libffi6/bionic,now 3.2.1-8 amd64 [installed]
  Foreign Function Interface library runtime

libffi6-dbg/bionic 3.2.1-8 amd64
  Foreign Function Interface library runtime (debug symbols)

libffindex0/bionic 0.9.9.7-4 amd64
  library for simple index/database for huge amounts of small files

libffindex0-dev/bionic 0.9.9.7-4 amd64
  library for simple index/database for huge amounts of small files (development)

libjffi-java/bionic 1.2.7-10 all
  Java Foreign Function Interface

libjffi-jni/bionic 1.2.7-10 amd64
  Java Foreign Function Interface (JNI library)
yanggs07 commented 5 years ago

to solve this:

1 apply the patch https://github.com/fpoirotte/php-ffi/commit/734630fe3d2e3efd343d3f3636b58446abd9c941.diff

wget https://github.com/fpoirotte/php-ffi/commit/734630fe3d2e3efd343d3f3636b58446abd9c941.diff
git apply 734630fe3d2e3efd343d3f3636b58446abd9c941.diff

2 make sure pkg-config is installed apt install pkg-config

3 phpize && ./configure