1、报错信息如下 /lib64/liblber-2.4.so.2: could not read symbols: Invalid operation
/usr/bin/ld: ext/ldap/.libs/ldap.o: undefined reference to symbol 'ber_scanf'
/usr/bin/ld: note: 'ber_scanf' 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: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
解决办法
./configure
vim MakeFile
开头是'EXTRA_LIBS' ,结尾加上 '-llber' ;
执行 make && make test && make install
2、php7编译后没有libphp7.so?
原因:php编译时,没有把扩展模块添加到 apache 中:
解决办法:(可参考另一篇文章: 官方手册)
1.检查configure是不是缺少一个 --with-apxs2 ,添加一下
2.然后确认apache2配置文件:apache2.conf或者httpd.conf,配置文件一般在/etc/apache2/...下,中是否含有以下配置:
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
如果有,则进行第3不,不然添加一下
3.重新 ./configure + 参数 make make install 重新安装安装一下,记得加--with-apxs2.
本文详细解析了PHP编译过程中遇到的错误信息,包括liblber符号读取失败的问题,并提供了解决方案。同时,针对PHP7编译后未能生成libphp7.so的情况,介绍了如何正确配置以确保PHP与Apache的顺利集成。

320

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



