简体   繁体   中英

intl PHP extension is not working for xampp server

I am trying to install CakePHP 3-0-0 version and I have downloaded the source code from here . But it is showing the error of enable intl extension . As I have already changed ;extension=php_intl.dll to extension=php_intl.dll (remove the semicolon) in php.ini file and restart xampp 2-3 times, but still it is showing that same error.

Here is the error below:

Fatal error: You must enable the intl extension to use CakePHP. in D:\xampp\htdocs\cakephp-3-0-0\config\bootstrap.php on line 38

So, can anyone please tell me what is the issue here? And what should I do to resolved this issue?

Once you have activated the php_intl.dll in the php.ini file you also need to copy the dll files that php_intl.dll uses from the PHP folder to the Apache/bin folder.

I am not a XAMPP user so I am not sure of the actual folder names

copy xampp/php/icu*.dll to xamp\\apache\\bin

Also remember that you have to edit the php.ini file that lives in the \\xampp\\apache\\bin folder and not the one in the \\xampp\\php folder.

The one in the \\xampp\\php folder only gets used by PHP CLI (Command Line Interface)

In my case problem was to restart Apache process. Restart in XAMPP control panel by clicking Stop and Start is not enough. I had to run Task Manager and kill httpd.exe process. Then run XAMPP again. That solve problem.

Just in case if you are using OSX

Steps from http://www.phpzce.com/blog/view/15/installing-intl-package-on-your-mac-with-xampp

  1. Check which php path is set ie

    root$: which php

  2. If you are using xampp on your mac it should be

    /Applications/XAMPP/xamppfiles/bin/php

but if its

/usr/bin/php 

you need to change your OSx php

root$: PATH="/Applications/XAMPP/xamppfiles/bin:${PATH}" 
  1. Install icu4c

    root$: brew install icu4c

  2. Install Intl via PECL

    root$: sudo pecl update-channels root$: sudo pecl install intl

  3. You can check if Intl was installed successfully

    root$: php -m | grep intl #should return 'intl'

Done

For me (not using any xampp, just Apache 2.4 and php 5.5. installed on Windows 7):

After uncommenting the intl-extension in php.ini, it didn't come active cause I only RESTARTED Apache server!

This is best to observe from phpinfo() page (try to find intl).

So I think the problem was solved when I stop and start the Apache server. (Probably same problem as in kaligari answer )

While trying solutions I moved the php folder and changed the folder to Apache conf file BUT forgot to change the environmental variable path to php, so after while I found this and got it work.

Control Panel->System->Advanced->Environmental variables->Path->Check php folder is there Thanks to Gregory Karpinsky

SO CHECK THAT IF EXTENSION IS STILL NOT LOADING!

No need to copy any files from php->apache\\bin. This is probably because I'm not using xampp BUT it is necessery to actually STOP and START over the Apache service to get it to reload the php extensions and have the path environmental variable correct.

如果您已配置基本设置,请尝试重新启动xampp ...它对我有用。

In both XAMPP and WAMP, mcrypt and mbstring extensions are working by default.

In XAMPP, intl extension is included but you have to uncomment extension=php_intl.dll in php.ini and restart the server through the XAMPP Control Panel.

In WAMP, the intl extension is “activated” by default but not working. To make it work you have to go to php folder (by default) C:\\wamp\\bin\\php\\php{version}, copy all the files that looks like icu*.dll and paste them into the apache bin directory C:\\wamp\\bin\\apache\\apache{version}\\bin. Then restart all services and it should be OK.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM