Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems to install php intl with Xampp (MacOs)

I´m installed Xampp in my Mac, the last version with Php7, all works fine, but in my Php proyect I´m using this function:

numfmt_format_currency() 

I need install the intl, and edit the php.ini with this line:

extension="intl.so”

The problem is, I can´t install the intl, I use this command:

sudo pecl install intl

But returns me this console error:

/private/tmp/pear/temp/intl/intl_error.h:24:10: fatal error: 'ext/standard/php_smart_str.h' file not found
#include <ext/standard/php_smart_str.h>
         ^
1 error generated.
make: *** [php_intl.lo] Error 1
ERROR: `make' failed

After, I try download the ntl-3.0.0.tgz from here, and Install whith this command:

sudo pear install intl-3.0.0.tgz

But return me this:

No releases available for package "pear.php.net/intl" - package pecl/intl can be installed with "pecl install intl"
install failed

I'm desperate, how can I install intl?

like image 360
RichardMiracles Avatar asked Nov 19 '16 09:11

RichardMiracles


1 Answers

You can use a PHP package from https://php-osx.liip.ch/. It already includes the intl extension.

This package installs the (usually) latest PHP 7.2/7.1/7.0/5.6/5.5/5.4/5.3 on OS X 10.6 (aka Snow Leopard), OS X 10.7 (aka Lion) and OS X 10.8 (aka Mountain Lion) and OS X 10.9 (aka Mavericks) and OS X 10.10 (aka Yosemite) and OS X 10.11 (aka El Capitan) and macOS 10.12 (aka Sierra) and macOS 10.13 (aka High Sierra) in /usr/local/php5. It installs many useful extensions (see below) and ini-settings and is what we at Liip use for our development. It's especially suited for Symfony 2 development. It also provides a decent php.ini with all settings configured according to "Best Practices".

Installation of PHP 7.2 is done via curl -s https://php-osx.liip.ch/install.sh | bash -s 7.2.

For more information have a look at the site and FAQ section.

like image 59
arueckauer Avatar answered Sep 20 '22 13:09

arueckauer