Install PHP intl extension on MacOS [closed]
Asked Answered
H

4

8

I am facing some issues in the installation of Cakephp. I hope any one had faced the same issue.

The error

- cakephp/cakephp 3.3.9 requires ext-intl * -> the requested PHP extension intl is missing from your system.

As per the error message, I removed ; from php.ini file but still getting the same error.

I have Mac 10.12 Sierra, Xampp 5.6.28-1 version and PHP 5.6.24 version.

Hostetter answered 7/2, 2017 at 8:33 Comment(4)
You can use MAMP... there it's included. Perhaps you can enable the intl extension in your php.ini?Maharaja
Thank you for your reply. I will try MAMP however I enabled all intl extension in php ini file in Xampp.Hostetter
These steps may help from a previously asked question: #27886617Management
Possible duplicate of Php-intl installation on XAMPPGarget
D
8
  1. Install the php5-intl extension brew install php56-intl
  2. If you get No available formula for php56-intl do brew tap homebrew/homebrew-php
  3. Restart Apache sudo apachectl restart
Depersonalize answered 29/10, 2017 at 22:27 Comment(2)
if we are using macOS HIgh Sierra version 10.13.6 the above steps will not run and give Error: homebrew/php was deprecated. This tap is now empty as all its formulae were migrated.Omnipotence
brew tap homebrew/homebrew-coreGodwit
L
6

intl is installed by default on php7.1 with brew.

If you already have php7.1, you might want to uninstall it first:

brew uninstall php71

Then install it with pear:

brew install php71 --with-pear

Then force the links:

brew link [email protected] --force
Lost answered 5/5, 2018 at 7:5 Comment(3)
This solution worked great for me. I was getting errors about missing ext-intl with the default PHP that comes with High Sierra. I ran these three commands (which I've read people talk about before, replacing the default PHP). I now think that is a great idea. Doing so upgraded my PHP version from 7.1.16 to 7.1.23 and changed my config folder to /usr/local/etc/php/7.1/php.ini. After, php --ini is a helpful command to run.Bk
It seems to create a weird scene in High Sierra if you start with a virgin Macbook and do brew install nginx and then setup your nginx.conf file. I swear that built-in PHP just doesn't work reliably and produces hard to trace symptoms. It was having trouble for me also trying to enable extension=snappy via brew install snappy. In my opinion, blow that garbage PHP off your machine and do the steps described in this answer by pl-94.Bk
The first warning sign is that intl comes with the built-in PHP and doesn't work. I installed php71 from brew and didn't even have to manually enable ext-intl, it just worked. You could imagine how a person could get trolled when it comes with the built-in, giving you a false sense of confidence that it would work.Bk
P
0

Try AMMPS. It has a lot great features and you can easily change PHP extensions:

enter image description here

Penal answered 7/2, 2017 at 8:47 Comment(1)
I tried installing ammps but the .dmg file does not open.Hostetter
F
-8

1 Make sure remove # from your php.ini file:

$extension=ext/php_intl.dll

2 If you have already enabled intl,add the path to environment and restart

3 Install by brew .

$brew install icu4c 
$sudo pecl install 
$intl php -m | grep intl 
Falster answered 7/2, 2017 at 9:12 Comment(3)
I did uncomment the ext/php_intl.dll but still I a getting this errorHostetter
dll files are for windows. For Mac OS X, it's .so file. By default, php-intl.so will be enabled in php.ini, so no need to change anything.Babysit
This solution is works only with Windows machineApocynthion

© 2022 - 2024 — McMap. All rights reserved.