php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7941 mcrypt 2.2 detected when mcrypt 2.4 is installed
Submitted: 2000-11-23 07:46 UTC Modified: 2000-12-23 20:41 UTC
From: astmail at yahoo dot com Assigned:
Status: Closed Package: Installation problem
PHP Version: 4.0.3pl1 OS: Linux 2.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: astmail at yahoo dot com
New email:
PHP Version: OS:

 

 [2000-11-23 07:46 UTC] astmail at yahoo dot com
When mcrypt 2.4 is installed as static and as dynamic library, e.g. /usr/lib/libmcrypt.a  and /usr/lib/libmcrypt.so, configure detects mcrypt_module_open *AND* init_mcrypt (the latter is contained in the static lib). In this case HAVE_LIBMCRYPT22 gets defined instead of HAVE_LIBMCRYPT24 resulting in a build failure.

The solution is to define HAVE_LIBMCRYPT24 when mcrypt_module_open is detected prior to checking for the results for init_mcrypt (change of sequence in configure script).

Note:
For linux the path to the mcrypt modules must be in ld.so.conf to prevent mcrypt failures in general.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-23 08:24 UTC] astmail at yahoo dot com
Patch to configure (beware, not configure.in) to show how to fix the problem:

--- cmp/php-4.0.3pl1/configure  Sun Oct 15 13:47:10 2000
+++ src/php-4.0.3pl1/configure  Sun Nov 12 20:30:17 2000
@@ -21675,12 +21675,7 @@
 
   LIBS=$old_LIBS
   LDFLAGS="$old_LDFLAGS"
-  if test "$ac_cv_lib_mcrypt_init_mcrypt" = "yes"; then
-       cat >> confdefs.h <<\EOF
-#define HAVE_LIBMCRYPT22 1
-EOF
-
-  elif test "$ac_cv_lib_mcrypt_mcrypt_module_open" = "yes"; then
+  if test "$ac_cv_lib_mcrypt_mcrypt_module_open" = "yes"; then
 
  case "ltdl" in
  c|c_r|pthread*) ;;
@@ -21695,6 +21690,11 @@
 
        cat >> confdefs.h <<\EOF
 #define HAVE_LIBMCRYPT24 1
+EOF
+
+  elif test "$ac_cv_lib_mcrypt_init_mcrypt" = "yes"; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_LIBMCRYPT22 1
 EOF
 
   else
 [2000-11-23 08:45 UTC] derick@php.net
Patches to configure are not useful at all... would you be so kind and make a patch for the config.m4 file in php4/ext/mcrypt? BTW, I naver had any troubles with this. Are you sure the static lib has version 2.4 of mcrypt?

 [2000-11-23 17:51 UTC] astmail at yahoo dot com
OK,
here's the config.m4 patch though I didn't test it (it should be reasonable enough):
================
--- cmp/php-4.0.3pl1/ext/mcrypt/config.m4       Sat Sep  9 14:24:20 2000
+++ src/php-4.0.3pl1/ext/mcrypt/config.m4       Thu Nov 23 23:48:01 2000
@@ -27,11 +27,11 @@
   AC_CHECK_LIB(mcrypt, mcrypt_module_open, [LIBS="$LIBS -lltdl"],[ ],)
   LIBS=$old_LIBS
   LDFLAGS="$old_LDFLAGS"
-  if test "$ac_cv_lib_mcrypt_init_mcrypt" = "yes"; then
-       AC_DEFINE(HAVE_LIBMCRYPT22,1,[ ])
-  elif test "$ac_cv_lib_mcrypt_mcrypt_module_open" = "yes"; then
+  if test "$ac_cv_lib_mcrypt_mcrypt_module_open" = "yes"; then
     AC_ADD_LIBRARY(ltdl)
        AC_DEFINE(HAVE_LIBMCRYPT24,1,[ ])
+  elif test "$ac_cv_lib_mcrypt_init_mcrypt" = "yes"; then
+       AC_DEFINE(HAVE_LIBMCRYPT22,1,[ ])
   else
     AC_MSG_ERROR(Sorry, I was not able to diagnose which libmcrypt version you
have installed.)
   fi
================
Yes, I'm sure it is mcrypt 2.4:
I detected the problem when I did build a system from scratch against glibc 2.2 so there never was a mcrypt version earlier than 2.4.7 on this system. Doing a grep against this version shows up init_mcrypt() and nm against libmcrypt.a shows, that init_mcrypt is exported in the static library whereas it is not in the dynamic one (libmcrypt.so).

 [2000-12-23 20:41 UTC] derick@php.net
This has been fixed in CVS
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 22:00:01 2026 UTC