意见箱
恒创运营部门将仔细参阅您的意见和建议,必要时将通过预留邮箱与您保持联络。感谢您的支持!
意见/建议
提交建议

PHP7的运行失败情况有什么,如何解决好

来源:恒创科技 编辑:恒创科技编辑部
2024-01-06 09:49:59
今天这篇我们来学习和了解“PHP7的运行失败情况有什么,如何解决好”,下文的讲解详细,步骤过程清晰,对大家进一步学习和理解“PHP7的运行失败情况有什么,如何解决好”有一定的帮助。有这方面学习需要的朋友就继续往下看吧!

php7.2运行失败的解决办法:1、在PHP源码目录下执行“vi Makefile”;2、找到EXTRA_LIBS行;3、在行末添加“-llber”;4、保存退出并再次make即可。


PHP7的运行失败情况有什么,如何解决好

本文操作环境:Windows7系统,PHP7.2版,Dell G3电脑。

php7.2运行失败怎么办?

php7.2 编译遇到的坑

checking size of long int... (cached) 8
configure: error: Cannot find ldap libraries in /usr/lib.

解决:

./configure php的时候出现下面错误而退出

configure: error: Cannot find ldap libraries in /usr/lib

解决办法:

cp -frp /usr/lib64/libldap* /usr/lib/

然后再./configure ...即可

/usr/bin/ld: ext/ldap/.libs/ldap.o: undefined reference to symbol 'ber_strdup' 
//usr/lib64/liblber-2.4.so.2: error adding symbols: DSO missing from command line 
collect2: error: ld returned 1 exit status 
make: *** [sapi/cli/php] Error 1

解决办法:遇到这种类似的情况,说明「./configure 」沒抓好一些环境变数值。

解决方法,来自老外的一篇文章:

在PHP源码目录下 vi Makefile 找到 EXTRA_LIBS 行,在行末添加 ‘ -llber ‘ 保存退出再次make即可

/usr/local/src/php-7.2.7/sapi/cli/php: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory
make: *** [ext/phar/phar.php] Error 127

解决:

1.先

#vi /etc/ld.so.conf

在里面加上一行 /usr/local/lib

2.然后运行/sbin/ldconfig

 #/sbin/ldconfig

编译make

Generating phar.phar
 
chmod: cannot access ‘ext/phar/phar.phar’: No such file or directory
make: [ext/phar/phar.phar] Error 1 (ignored)

解决:

cd ext/phar/
cp ./phar.php ./phar.phar

关于“PHP7的运行失败情况有什么,如何解决好”就介绍到这了,如果大家觉得不错可以参考了解看看,如果想要了解更多,欢迎关注恒创科技,小编每天都会为大家更新不同的知识。
上一篇: PHP7中关闭、禁止缓存的代码如何写 下一篇: PHP7连不上mysql8的处理方案是什么