本文操作环境:windows7系统,php7.2版,dell g3电脑。
php7.2运行失败怎么办?
php7.2 编译遇到的坑
checking size of long int... (cached) 8configure: 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 directorymake: *** [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 directorymake: [ext/phar/phar.phar] error 1 (ignored)
解决:
cd ext/phar/cp ./phar.php ./phar.phar
推荐学习:《php视频教程》
以上就是php7.2运行失败怎么办的详细内容。
