Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checking for libsmbclient.h in default paths... not found #97

Open
shaqaruden opened this issue May 10, 2022 · 3 comments
Open

checking for libsmbclient.h in default paths... not found #97

shaqaruden opened this issue May 10, 2022 · 3 comments

Comments

@shaqaruden
Copy link

Running pecl install smbclient on alpine. I have tried installing apk add samba-client and also tried apk add samba. I see that libsmbclient is being install.

Searching from root find . -print | grep -a "libsmbclient only returns

./usr/lib/libsmbclient.so.0
./usr/lib/libsmbclient.so.0.7.0
./usr/lib/samba/libsmbclient-raw-samba4.so

@eduardok
Copy link
Owner

find /usr -type f -name libsmbclient.h
or
locate libsmbclient.h
Does it find it anywhere?
I think you need:
apk add samba-dev

@project2021-code
Copy link

I have the similar problem in FreeBSD.

./configure

checking for libsmbclient support... yes, shared
checking for libsmbclient.h in default paths... not found
configure: error: Could not find libsmbclient.h
root@test1:/tmp/php-ext/ext/smbclient # find / -name libsmbclient.h
/usr/local/include/samba4/libsmbclient.h

In file configure, I find that the directory it search for the libsmbclient.h is in Line 4693

    for i in /usr/local/include /usr/local/include/samba-* /usr/include /usr/include/samba-* ; do

It doesn't search /usr/local/include/samba4

If I add /usr/local/include/samba* to Line 4693, I will get

checking whether to enable smbclient support... yes, shared
checking for libsmbclient support... yes, shared
checking for libsmbclient.h in default paths... found in /usr/local/include/samba4
checking for smbc_getOptionUserData in -lsmbclient... no
configure: error: Could not find libsmbclient.so or symbol smbc_getOptionUserData. Check version and config.log for more information.

@project2021-code
Copy link

Found the solution, for FreeBSD, please refer to the Makefile in the Ports. You need to use --with-libsmbclient to specific the Local Base Directory and CPPFLAGS & LDFLAGS to specific the library location.

phpize

./configure \
--with-libsmbclient=/usr/local \
CPPFLAGS=-I/usr/local/include/samba4 \
LDFLAGS=-L/usr/local/lib/samba4

make test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants