Friday, December 17, 2010

PHP : "intl" extension, Windows, Apache

PHP Internationalization support ("intl") is bundled as of PHP 5.3.0 and does not require PECL:
http://www.php.net/manual/en/intl.installation.php

Things to check if it does not work under Windows/Apache:

  1. php_intl.dll exists in the "ext" folder of the PHP root ( normally it's c:\Program Files\PHP\ext )
  2. The php.ini file in c:\Windows folder has these lines:
    extension_dir="C:\Program Files\PHP\ext"
    extension=php_intl.dll
    (php.ini in c:\Program Files\PHP may work too, but I keep it in Windows folder so it's not accidentally removed when PHP is upgraded)
  3. There are ICU .dll files in c:\Program Files\PHP:
    icudt*.dll
    icuin*.dll
    icuio*.dll
    icule*.dll
    iculx*.dll
    icutu*.dll
    icuuc*.dll
     (* is version number, for example icudt36.dll)
  4. c:\Program Files\PHP is in the %PATH% (environment variables in Control Panel - System - Advanced - ...)
    Without that, the ICU dlls are not loaded by PHP as Apache module - no error message is displayed, but the extension is not in the phpinfo().