问题描述
今天在编译PHP7是抛出一下错误提示:
/usr/bin/ld: ext/ldap/.libs/ldap.o: undefined reference to symbol ‘ber_strdup’
/usr/bin/ld:note: ‘ber_strdup’ is defined in DSO /lib64/liblber-2.4.so.2 so try adding it to the linker command line
/lib64/liblber-2.4.so.2:could not read symbols: Invalid operation
collect2:error: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
解决办法
在PHP源码目录下 vi Makefile 打开文件,找到 EXTRA_LIBS 行,在行末添加 -llber 保存退出再次make即可

本文解决在编译PHP7时遇到的与LDAP扩展相关的链接错误,具体为未定义符号‘ber_strdup’的问题。通过修改Makefile,在EXTRA_LIBS行末添加-llber参数,成功解决了编译过程中的链接失败。
2178

被折叠的 条评论
为什么被折叠?



