eduardok / libsmbclient-php

smbclient's extension for PHP
Other
96 stars 21 forks source link

pecl install smbclient, and error:Could not find libsmbclient.h #92

Closed tiandiyiqi closed 1 year ago

tiandiyiqi commented 2 years ago

centos8 php7.4

[root@cloud libsmbclient-php]# pecl install smbclient WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update downloading smbclient-1.0.6.tgz ... Starting to download smbclient-1.0.6.tgz (33,207 bytes) .........done: 33,207 bytes 4 source files, building running: phpize Configuring for: PHP Api Version: 20190902 Zend Module Api No: 20190902 Zend Extension Api No: 320190902 building in /var/tmp/pear-build-rootBjDxOF/smbclient-1.0.6 running: /var/tmp/smbclient/configure --with-php-config=/usr/bin/php-config 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 -R... no 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 -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib checking for PHP extension directory... /usr/lib64/php/modules checking for PHP installed headers prefix... /usr/include/php checking if debug is enabled... no checking if zts is enabled... no checking for gawk... gawk checking whether to enable smbclient support... yes, shared checking for libsmbclient support... yes, shared checking for libsmbclient.h in default paths... not found configure: error: Could not find libsmbclient.h ERROR: `/var/tmp/smbclient/configure --with-php-config=/usr/bin/php-config' failed

remicollet commented 2 years ago

Message seems clear:

configure: error: Could not find libsmbclient.h

So you need to install the missing headers. Tips

dnf whatprovides */libsmbclient.h

Alternative way, instead of building from sources, use a repository providing PHP and its extension, e.g. https://rpms.remirepo.net/