3

I was trying to install intl, a php extension required by Moodle. I used sudo pecl install intl and received the following error:

/private/tmp/pear/install/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

When it prompted Specify where ICU libraries and headers can be found [DEFAULT] : I hit enter.

And I have installed autoconf by brew install autoconf

How to tackle this issue? Thank you!

1 Answers1

1

As you can see on this link intl is no longer maintained and is not compatible with later versions of PHP. It is now included in most PHP distributions. The brew version contains it.

What you should do instead is the following:

  • brew install php@7.3 (or whatever the latest version is)
  • brew link --overwrite --force php@7.3
  • Override the PHP binary in your path see below assuming you are using bash (note that it needs to supersede any other PHP binaries )
echo 'export PATH="/usr/local/opt/php@7.3/bin:/usr/local/opt/php@7.3/sbin:$PATH"' >> ~/.bash_profile 
  • Source your bash profile (. ~/.bash_profile)
  • check the intl module (php -m | grep intl)