"php.h not found" error when installing Intl extension on Mac

2

I'm having trouble installing the intl extension on the Mac, I've already done the following tutorials:

but in the 3 I lock in the following command:

sudo pecl install intl

and I get the following error message:

In file included from /private/tmp/pear/temp/intl/php_intl.c:25:
/private/tmp/pear/temp/intl/php_intl.h:23:10: fatal error: 'php.h' file not found
#include <php.h>
     ^
1 error generated.
make: *** [php_intl.lo] Error 1
ERROR: 'make' failed

I've tried searching for the specific error but I could not find an answer.

Has anyone ever had the same error?!

    
asked by anonymous 27.08.2014 / 19:49

2 answers

0

See if it helps you

Install some dependencies with Homebrew:

$ brew install autoconf
$ brew install icu4c 
$ brew link --force icu4c    

Install and check Pear / PECL ( source ) :

$ curl -O http://pear.php.net/go-pear.phar
$ sudo php -d detect_unicode=0 go-pear.phar
  [ Select 1 and enter /usr/local/pear ]
  [ Select 4 and enter /usr/local/bin ]
  [ Press return ]
$ pear version

Install PECL intl :

$ sudo pecl install intl
$ sudo cp /private/etc/php.ini{.default,}
$ sudo chmod 644 /private/etc/php.ini
$ echo extension=intl.so >> /private/etc/php.ini
    
27.08.2014 / 20:08
0

You can install intl via Brew.

Use the command: brew install homebrew/php/php55-intl

    
02.02.2016 / 17:36