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

Asked

Viewed 1,765 times

2

I’m having problems installing the extension Intl on Mac, already followed the following tutorials:

but on the 3 I brake on the following control:

sudo pecl install intl

and receive 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 have tried searching for the specific error but could not find an answer.

Someone’s been through the same mistake?!

3 answers

0


See if that 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

Instala PECL lntl:

$ 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
  • followed the steps and arriving at the sudo pecl install Intl command continues the cited error, php. h not found.

  • tries Brew install php55-Intl

  • Hello Otto, I get the following error: Error: No available formula for php55-Intl

  • I’m trying to help I’ll research a little more here

  • you ran Xcode-select --install ?

  • Also @Otto, only I get the following error: Xcode-select: error: invalid argument '-install'. Thanks for the effort so far

  • @Marconiomafessolli: Don’t edit user responses to modify something that hasn’t worked specifically for you. You could even supplement the answer given by saying that "if it doesn’t work with X, you can try with Y", aggregating information, never replacing it (unless it’s REALLY wrong)

Show 2 more comments

0

The headers PHP is not installed on Mojave, if someone is having this problem today, do the following:

1) Installs xCoce CLT

xcode-select --install

2) Reinstall the headers files:

sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

0

You can install Internet via Brew.

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.