views:

27

answers:

2

Hey guys,

I'm trying to load this module: php_mcrypt.dll' Everything in the php.ini file is correct, see for yourself:

extension_dir = "C:/PHP/5.2.13/ext"
extension=php_mcrypt.dll

The file exists in this path. And other modules are in there as well and are loaded successfully. It only has a problem with this particular module.

I have a 64bit Windows XP, Apache 2.2, PHP 5.2.13...

But i get this warning (error.log of Apache): PHP Warning: PHP Startup: Unable to load dynamic library 'C:/PHP/5.2.13/ext\php_mcrypt1.dll' - The specified module could not be found.\r\n in Unknown on line 0

PHP itself is working fine. But one of our applications needs this module and it throws me this ugly error. Why on earth does it show me two backslashes in the log file?

A: 

'C:/PHP/5.2.13/ext\php_mcrypt1.dll'

I'd say there's some typo on your php.ini (the extra 1). Perhaps you're loading a different php.ini from what you expect (see the output of php.ini to make sure).

Other than that make sure that php_mcrypt.dll and PHP:

  • Were linked to the same VC runtime library (typically msvcrt.dll for VC6 or msvcrt90.dll for VC9) – use e.g. the dependency walker for this
  • Are both debug builds or both release builds
  • Both have ZTS enabled or ZTS disabled
  • For libraries that depend on further libraries (DLLs), make sure they are available (e.g. in the same directory as the extension)

PHP should give you meaning errors if any of the first three conditions above is not satisfied, but I wrote those anyway because I'm not sure for PHP 5.2.

Artefacto
A: 

Guys, I found the solution!

Thank god for this article! http://blogs.iis.net/donraman/archive/2009/10/16/configuring-php-extension-on-windows-a-simple-way.aspx


There has been too many problem reported in our forum about not able to configure one particular extension. The problems are many:

* Configuring a non-compatible version of the extension
* Missing some dependent DLL
* Trying to use thread safe version of the extension DLL  for non thread safe PHP build and vice-versa

So, I basically installed PHP in a different directory using the PHP MSI installer, which can be found here: http://windows.php.net/download/. I only installed PHP, without the Apache Server, and selected the mcrypt extension. After the installation was done, I copied the dll file into my real PHP directory, restarted Apache and it worked!

Kel
Which is basically what I said in my response....
Artefacto