Why doesn't PHP on Windows see the php_intl.dll extension, even if it exists?

I am 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 not start it and start it.

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

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

PHP Warning: starting PHP: cannot load the dynamic-link library 'c: \ wamp \ php5.5 \ ext \ php_intl.dll' - the specified module was not found. \ r \ n in Unknown on line 0

I repeat, but c: \ wamp \ php5.5 \ ext \ php_intl.dll EXISTS!

I have a desire to try pointing to Windows Explorer and screaming on my computer: "WATCH! STINK FILE IS CORRECT!" Any idea why I can see the file and PHP cannot, although we are apparently looking in the same directory? Or is something else going on that I missed?

+6
source share
7 answers

Make sure Apache can find and download icu * .dll files from the PHP base directory.

A quick, easy solution is to copy these dlls to the Apache bin directory.

+12
source

Although the SeventyFourLaboratories solution is simple and it works, there is a solution that does not require changing your Apache or PHP distribution (and sometimes you are not allowed to change them on production servers).

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

I tried setting C:\wamp\php5.5 in my custom PATH variable and this will not work. But setting it in the system PATH variable makes it work. So, you should check that you are using the PATH system variable to configure Apache instead of the user variable with the same name.

+3
source

I had the same problem, and after almost 5 hours of working on this problem, I finally decided to solve it. There were two major changes that I had to make.

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

2) The smaines answer to alaya dot com , presented as a comment here , gave me the second thing I needed to do - add the path to the ext folder for the Windows variable $ PATH.

There are many ways to do this, here is one of them:

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

After making the above changes, you need to restart your computer so that they can affect.

I hope this helps, it worked for me. This seems to be a fairly common problem - at least I found quite a bit of discussion on it and its variations.

+2
source

It drove me crazy. I had everything icll dll in my way, etc. In the end, installing Visual C ++ 2015 x86 solved it for me.

+1
source

A full fix would be to modify C: \ wamp \ scripts \ config.inc.php as follows:

Find this section of this 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', ); 
0
source

HOW to add your PHP.exe location to PATH.

(Windows 7 GUI)

For administrator access to "Environment variables: system variables", follow the instructions here: https://kb.wisc.edu/cae/page.php?id=24500

In the "Environment Variables: System Variables" section, edit the "Path" variable and the prefix of the existing line (DO NOT DELETE THIS) with your location. for example: C: \ wamp \ bin \ php \ php5.5.12;

  • Worked for me.
0
source

Correction to the above posts

If you add the php folder to PATH, be sure to add the 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.

0
source

Source: https://habr.com/ru/post/950742/