php – 无法编译mcrypt(配置失败:-lmhash中的mhash_keygen … no)

weixin_38078242 2019-09-12 01:01:51
Problem solved by Shawn Chin in Answer 1. And what drives me crazy is that to compile mcrypt extension, only libmcrypt is enough, there is no need to compile mhash and mcrypt 🙁 我想为php编译mcrypt扩展(RHEL5.1,Intel i5 650),这是我的程序 # libmcrypt tar zxf libmcrypt-2.5.8.tar.gz cd libmcrypt-2.5.8 ./configure --prefix=/home/felix021/lamp/libmcrypt/ make make install # mhash tar jxf mhash-0.9.9.9.tar.bz2 cd mhash-0.9.9.9 ./configure --prefix=/home/felix021/lamp/mhash/ make make install # mcrypt LD_LIBRARY_PATH=/home/felix021/lamp/libmcrypt/lib:/home/felix021/lamp/mhash/lib ./configure --prefix=/home/felix021/lamp/mcrypt/ \ --with-libmcrypt-prefix=/home/felix021/lamp/libmcrypt 配置失败并注意到: checking for mhash_keygen in -lmhash... no configure: error: "You need at least libmhash 0.8.15 to compile this program. \ http://mhash.sf.net/" 所以我下载了mhash0.8.18和mhash0.8.15,但是发生了同样的错误. 我在0.8.15 / 8中查找了“mhash_keygen”: int mhash_keygen(xxx,xxx,xxx) 它在0.9.9.9: #if defined(PROTOTYPES) mutils_error mhash_keygen(keygenid algorithm, ....) #else mutils_error mhash_keygen(); #endif //typedef uint32 mutils_error 但是,mcrypt-2.6.8 / configure 12114,它是: char mhash_keygen (); 我在配置中将“char”更改为“mutils_error”,错误仍然出现. 我还能做些什么……? 感谢您阅读我的loooooooong问题.
...全文
86 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_38080355 2019-09-12
  • 打赏
  • 举报
回复
我已经在RHEL5盒子上回溯了你的步骤,并且确实得到了同样的错误. 在config.log中,看起来无法找到libmhash. configure:12093: checking for mhash_keygen in -lmhash configure:12128: gcc -o conftest -g -O2 conftest.c -lmhash >&5 /usr/bin/ld: cannot find -lmhash collect2: ld returned 1 exit status 应该有一个更简洁的方法,但我设法通过提供lib和包含mhash目录通过额外的CFLAGS和LDFLAGS来配置和编译mcrypt. # mcrypt export LD_LIBRARY_PATH=/home/felix021/lamp/libmcrypt/lib:/home/felix021/lamp/mhash/lib export LDFLAGS="-L/home/felix021/lamp/mhash/lib/ -I/home/felix021/lamp/mhash/include/" export CFLAGS="-I/home/felix021/lamp/mhash/include/" ./configure --prefix=/home/felix021/lamp/mcrypt/ \ --with-libmcrypt-prefix=/home/felix021/lamp/libmcrypt

433

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧