9

I've been trying to get the intl extension working on my test workstation (PHP 5.5.1, Apache 2.2.4, Windows 7 32-bit). It seems that no matter what I try I can't get it up and running.

  • I've uncommented the line "extension=php_intl.dll" in my php.ini.
  • I've verified the extension_dir directive is pointing at the correct directory (c:\wamp\php5.5\ext).
  • I've verified php_intl.dll is in c:\wamp\php5.5\ext.
  • I've verified that all the icu*.dll files are present in the php root directory (c:\wamp\php5.5).
  • I've verified that c:\wamp\php5.5 is in my PATH.
  • And yes, the copy of php.ini I'm editing is the correct one, the one specified by the PHPIniDir directive in httpd.conf.

I've checked the Apache error log and found this line every time I've restarted Apache:

PHP Warning: PHP Startup: Unable to load dynamic library 'c:\wamp\php5.5\ext\php_intl.dll' - The specified module could not be found.\r\n in Unknown on line 0

I repeat myself, but c:\wamp\php5.5\ext\php_intl.dll DOES EXIST!

I'm tempted to try pointing at Windows Explorer and shouting at my computer, "LOOK! THE STINKIN' FILE IS RIGHT THERE!" Any idea why I can see the file and PHP cannot even though we're apparently looking in the same directory? Or is something else going on that I've missed?

PerceptorII
  • 119
  • 1
  • 1
  • 5

7 Answers7

18

Make sure that Apache can find and load icu*.dll files from PHP base dir.

Fast, simple solution is to copy these dll's to Apache bin directory.

  • This works for me!!!. Just copy all icu*.dll to apache bin folder. Using Wamp server with apache 2.4.4, php 5.4.16 – gonzalezea Apr 06 '14 at 00:37
  • 2
    I tested this with a manual installation Apache+PHP, and it worked! As soon as I saw you were right, I deleted the files from Apache24/bin, so I expected `intl` won't be recognized again but it still works, I wonder why... It would be interesting to know the real answer and make Apache recognize those `icu*.dll` files without copying them. Someone knows how? Thanks – Metafaniel Jul 22 '14 at 15:39
  • Worked for me in WAMP, [path to wamp]/wamp/bin/php/php[version Number]/ - copied all icu*.dll files to - [path to wamp]/wamp/bin/apache/apache[version Number]/bin/ Thank you! – JxAxMxIxN Dec 27 '14 at 01:55
  • Worked in wamp too. Thanks a lot – alynurly Feb 17 '21 at 11:28
5

Although SeventyFourLaboratories's solution is simple and it works, there is a solution that doesn't require you to modify your Apache or PHP distribution (and sometimes, you are not allowed to change them in production servers).

You said you've verified C:\wamp\php5.5 is in your PATH. Windows has two kinds of environment variables: user and system variables.

I've tried to set C:\wamp\php5.5 in my user variable PATH, and it doesn't work. But, setting it in the system variable PATH makes it work. So, you should verify that you use the PATH system variable to configure Apache instead of a user variable with the same name.

rchavarria
  • 930
  • 10
  • 16
3

I had this exact same problem and after close to 5 hours of working on this issue I finally got it resolved. There were two main changes that I had to make.

1) When I downloaded the extension I was trying to use, it came with many other files beyond just the .dll file - most of them were .pdb. I moved all of them into the ext folder that contains the .dll files.

2) The answer by smaines at alaya dot com provided as a comment here gave me the second thing that I needed to do - add the path to the ext folder to windows $PATH variable.

There are many ways this can be done, here is one:

  • Go to my computer
  • Right click and select properties
  • Click 'Advanced system settings' on the left
  • Click on the 'Advanced' tab at the top
  • Click the 'Environment Variables' button
  • Search through the list of variables to find the 'Path' variable, select it
  • Click the 'Edit...' button (when the 'Path' variable is selected)
  • This will bring up another dialog box with two input fields. The bottom one is the variable, select it.
  • Append to the end a semicolon then the path, in this case you would type ';C:\wamp\php5.5\ext' (the semicolon is just to separate it from the previous path
  • click 'OK' in all the dialog boxes that have come up to close them

After making the above changes you need to restart your machine for them to take affect.

I hope that helps, it worked for me. It seems like this is a fairly common problem - at least I found quite a few discussions on it and variations of it.

MrMadsen
  • 2,713
  • 3
  • 22
  • 31
  • Adding the php directory (not the ext directory) to the PATH solved it for me. Restart is not needed, just log off and log in again. – user2345998 Aug 22 '17 at 11:30
3

This was driving me crazy. I had all the icu dlls in my path etc. In the end installing Visual C++ 2015 x86 solved it for me.

ppamment
  • 61
  • 2
1

complete fix would be to change C:\wamp\scripts\config.inc.php as follow:

Find this section of that file

$phpDllToCopy = array (
'fdftk.dll',
'fribidi.dll',
'libeay32.dll',
'libmhash.dll',
'libmysql.dll',
'msql.dll',
'libmysqli.dll',
'ntwdblib.dll',
'php5activescript.dll',
'php5isapi.dll',
'php5nsapi.dll',
'ssleay32.dll',
'yaz.dll',
'libmcrypt.dll',
'php5ts.dll',
'php4ts.dll');

And change it to

$phpDllToCopy = array (
'fdftk.dll',
'fribidi.dll',
'icudt51.dll', // - Additions to avoid unknown error PHP 5.5.5
'icuin51.dll',
'icuio51.dll',
'icule51.dll',
'iculx51.dll',
'icutest51.dll',
'icutu51.dll',
'icuuc51.dll',
'icudt50.dll', // - Additions to avoid unknown error PHP 5.5
'icuin50.dll',
'icuio50.dll',
'icule50.dll',
'iculx50.dll',
'icutest50.dll',
'icutu50.dll',
'icuuc50.dll',
'icudt49.dll', // - Additions to avoid unknown error PHP 5.3/5.4
'icuin49.dll',
'icuio49.dll',
'icule49.dll',
'iculx49.dll',
'icutest49.dll',
'icutu49.dll',
'icuuc49.dll',
'libeay32.dll',
'libmhash.dll',
'libmysql.dll',
'libsasl.dll', // - Additions to avoid unknown error
'msql.dll',
'libmysqli.dll',
'ntwdblib.dll',
'php5activescript.dll',
'php5isapi.dll',
'php5nsapi.dll',
'ssleay32.dll',
'yaz.dll',
'libmcrypt.dll',
'php5ts.dll',
'php4ts.dll',
);
Vix
  • 11
  • 3
  • config.inc.php now has an array - add the number of four icu, in my case 61. But sadly still not working, so I'm lacking something else. //dll to create symbolic links from php to apache/bin // // Versions of ICU are 38, 40, 42, 44, 46, 48 to 57 $icu = array( 'number' => array('57', '56', '55', '54', '53', '52', '51', '50', '49', '48', '46', '44', '42', '40', '38'), 'name' => array('icudt', 'icuin', 'icuio', 'icule', 'iculx', 'icutest', 'icutu', 'icuuc'), ); – anmari Jul 13 '18 at 11:09
  • FOR php 2.7.8, Now add '62' in array of the code around line 131 in C:\wamp\scripts\config.inc.php, then exit WAMP and restart – anmari Jul 27 '18 at 02:48
1

HOW TO add your PHP.exe location to PATH.

(Windows 7 GUI)

For admin access to "Environment Variables : System Variables", follow instruction here: https://kb.wisc.edu/cae/page.php?id=24500

In "Environment Variables : System Variables", edit the 'Path' variable and prefix the existing string (DO NOT DELETE IT), with your location. eg: C:\wamp\bin\php\php5.5.12;

  • Worked for me.
Paul V
  • 351
  • 3
  • 9
0

Correction to above messages

If you are adding php folder to PATH, make sure to add php folder, not the php/ext folder.

In my case it was C:\wamp\bin\php\php5.5.12, not C:\wamp\bin\php\php5.5.12\ext.