How can I install intl PHP extension in PHP 7.1.7, which is delivered with osx high sierra?
asked Oct 9, 2017 at 18:38
So I had the exact same issue. As noted by other folks commenting here, High Sierra comes with PHP 7.1 installed and this PHP version has intl compiled with it
In my case, I followed part of Neodork comment's in the following Valet+ issue:
"Install" PHP 7.1 [so it comes from brew itself, not the one installed by High Sierra]
brew install
Upgrade it to latest version
brew upgrade
Symlinks for references in Cellar:
brew link --overwrite --force
Change PHP path in my bash profile
echo 'export PATH="/usr/local/opt//bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt//sbin:$PATH"' >> ~/.bash_profile
Reload your bash profile [you can close the terminal and open it again]
. ~/.bash_profile
Check for Intl
php -m | grep intl
Note: If you come across with warnings like:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-intl/intl.so'
Then you have to disable the previous intl:
mv /usr/local/etc/php/7.1/conf.d/ext-intl.ini /usr/local/etc/php/7.1/conf.d/ext-intl.ini.disabled
Hope it helps!
answered Jul 10, 2018 at 21:20
7
After the integration from brew/php
to brew/core
, the intl
extension is included by the default installation. I also had the same problem the intl
extension wasn't working. The problem I had was the
command-line environment was not using the installed version of PHP but the default version from macOS system.
To enable the installed version, you need to do this:
After
brew install
You need to link the installed PHP version by
brew link
Then you need to OPEN A NEW TERMINAL to make it effective.
Then double check the PHP binary path,
which php
make sure it's
/usr/local/bin/php
instead of
/usr/bin/php
Then check if the intl extension is enabled,
php -m | grep intl
It works for me.
answered Jul 4, 2018 at 20:14
jallen0927jallen0927
3504 silver badges14 bronze badges
1
open a terminal then type:
brew search intl
you should be able to see php71-intl, then run
brew install homebrew/php/php71-intl
then restart apache
sudo apachectl restart
then type:
php -i | grep intl
you should be able to see something like this:
Additional .ini files parsed => /usr/local/etc/php/7.1/conf.d/ext-intl.ini
intl
intl.default_locale => no value => no value
intl.error_level => 0 => 0
intl.use_exceptions => 0 => 0
Enjoy!
answered Dec 25, 2017 at 12:11
7
I'm running the brew 1.6.2, on OS High Sierra. The intl extension is not available in brew packages so far.
The @Mondy solution worked fine for me. After run the
curl -s //php-osx.liip.ch/install.sh | bash -s 7.1
The packages will be available in /usr/local/php5 or /usr/local/php5-7.0.27-20180201-135220.
So in your /usr/local/etc/php/7.0/php.ini you can place the following lines to enable the intl extension:
[intl]
extension="/usr/local/php5/lib/php/extensions/no-debug-non-zts-20151012/intl.so"
In my case I prefered to create a file 'ext-intl.ini' in /usr/local/etc/php/7.0/conf.d/, just for a better organization.
answered Apr 26, 2018 at 8:17
LipdkLipdk
711 silver badge2 bronze badges
4
In addition to what L. Grolleau says [run brew install php71-intl
], paste the int.so
path to the /php.ini
at the end of the file:
extension=/usr/local/Cellar/php71-intl/7.1.11_20/intl.so
answered Nov 17, 2017 at 21:23
I find a solution.
curl -s //php-osx.liip.ch/install.sh | bash -s 7.1
Then I copied intl.so from the installation to my extension directory, which is defined into my php.ini.
answered Oct 9, 2017 at 19:40
MondyMondy
1,8373 gold badges15 silver badges29 bronze badges
3
I have managed to work this out.
First uninstall any php packages you have completely with brew, then run the brew update
and brew doctor
commands.
Now install with brew install
[changed the version as needed] intl is included in the build for all php-formulae.
To confirm it is working run php -m | grep intl
. You will see the intl extension is included. If not check the php.ini file and make sure the extension is being loaded.
webmaster777
1,3452 gold badges12 silver badges16 bronze badges
answered Apr 7, 2018 at 8:01
1
Remove the following file with
rm /usr/local/etc/php/7.1/conf.d/ext-intl.ini
Worked for me, thanks to homebrew-core Issue
answered Sep 11, 2018 at 23:51
I installed php7.2 with brew and linked with that version on Mac, but cannot see even the version number 7.2 in phpinfo[]
. It always showed the last version[7.1] even though uninstall with brew, so the intl extension. I found we have to modify httpd.conf file[in my case in /etc/apache2/httpd.conf], in that file you can find the
LoadModule php7_module libexec/apache2/libphp7.so
in that line you have to override with your new php72 path: in my case it was
LoadModule php7_module /usr/local/Cellar//7.2.31_1/lib/httpd/modules/libphp7.so
And restart apache, it works fine.
answered Jun 27, 2020 at 10:52
CristianRCristianR
3053 silver badges5 bronze badges
try this
brew install homebrew/php/php71-intl
answered Feb 2, 2018 at 21:31
MTMMTM
1031 silver badge8 bronze badges