0

I installed php56 via homebrew

brew install php56

Loaded it into apache in httpd.conf

LoadModule php5_module    /usr/local/Cellar/php56/5.6.31_7/libexec/apache2/libphp5.so

And everything seems fine. But when I added php-intl

brew install php56-intl

Intl, doesn't load, and I get the following error:

PHP Core Warning 'yii\base\ErrorException' with message 'PHP Startup: 
Unable to load dynamic library '/usr/local/opt/php56-intl/intl.so' - dlopen(/usr/local/opt/php56-intl/intl.so, 9): 
Symbol not found: _compiler_globals
Referenced from: /usr/local/opt/php56-intl/intl.so
Expected in: flat namespace in /usr/local/opt/php56-intl/intl.so' 

What is strange, it works fine when using php-cli(/usr/local/bin/php), error only appears when loading as apache module.

What is my misconfiguration?

roma
  • 1,512
  • 10
  • 20
  • Try `brew reinstall php56-intl --build-from-source` – ceejayoz Nov 17 '17 at 00:26
  • That didn't work, but for some reason you answer guided me to look into /usr/local/etc/httpd/httpd.conf and there was also a different php version there. /usr/local/Cellar/php56/5.6.32_8/libexec/apache2/libphp5.so . After I changed apache module to load this, everything works fine. I'm not sure what is that config for(it's not used in my system), but it has the correct module link. Thank you, in some strange way your answer really helped! – roma Nov 17 '17 at 00:47

1 Answers1

0

You can try brew search intl first like below:

➜ brew search intl
==> Searching local taps...
homebrew/php/php53-intl                 homebrew/php/php55-intl                 homebrew/php/php70-intl                 intltool
homebrew/php/php54-intl                 homebrew/php/php56-intl                 homebrew/php/php71-intl
==> Searching taps on GitHub...
==> Searching blacklisted, migrated and deleted formulae...

Then select the right version 'intl' to install, for example:

brew search intl
C.K.
  • 4,348
  • 29
  • 43