我希望有人能帮助我解决当前的问题。
设想:从源代码安装 libmcrypt、mhash 和 mcrypt 以便在启用 mcrypt 扩展的情况下编译 PHP5.4。
操作系统:RHEL-6(在 openshift 上)
脚步: 编译并安装了 libmcrypt 和 mhash,没有任何问题。继续安装 mcrypt,最初,我遇到了找不到 mhash 库的问题。我按照说明操作这里!
导出环境变量后,我能够传递该错误,但现在 mcrypt 因以下错误而无法编译:
configure: WARNING: mcrypt.h: accepted by the compiler, rejected by the preprocessor!
我拉取了 config.log 并看到此错误:
configure:6289: checking how to run the C preprocessor
configure:6329: gcc -E conftest.c
configure:6335: $? = 0
configure:6366: gcc -E conftest.c
conftest.c:13:28: error: ac_nonexistent.h: No such file or directory
configure:6372: $? = 1
我已经在网上搜索过了,但还没有找到。有没有什么办法可以成功编译/安装 mcrypt?
我是否需要导出另一个环境变量来帮助我的预处理器找到正确的库?
以下是我传递的命令:
export LD_LIBRARY_PATH=/var/lib/openshift/515b7bbd4382eca7d500002a/diy-0.1/runtime/srv/libmcrypt/lib:/var/lib/openshift/515b7bbd4382eca7d500002a/diy-0.1/runtime/srv/mhash/lib
export LDFLAGS="-L/var/lib/openshift/515b7bbd4382eca7d500002a/diy-0.1/runtime/srv/mhash/lib"
export CFLAGS="-I/var/lib/openshift/515b7bbd4382eca7d500002a/diy-0.1/runtime/srv/mhash/include"
#mcrypt
./configure --prefix=/var/lib/openshift/515b7bbd4382eca7d500002a/diy-0.1/runtime/srv/mcrypt --with-libmcrypt-prefix=/var/lib/openshift/515b7bbd4382eca7d500002a/diy-0.1/runtime/srv/libmcrypt