Skip to content

Instantly share code, notes, and snippets.

@tayhimself
Created July 13, 2018 22:10
Show Gist options
  • Save tayhimself/de682177bb0a5d67add8cc9c5a2b0a27 to your computer and use it in GitHub Desktop.
Save tayhimself/de682177bb0a5d67add8cc9c5a2b0a27 to your computer and use it in GitHub Desktop.
PHP intl extension using macOS 10.13 PHP 7.1.x

If you're using brew you need to do nothing. weprovide/valet-plus#127

If you're using the native macos PHP, make sure php is running fine, and see what modules are installed

$php -m

You will see a bunch of modules but they're missing intl

Go here and choose the install script you need to go https://php-osx.liip.ch/

$curl -s http://php-osx.liip.ch/install.sh | bash -s 7.1

Now the default macOS PHP does not have a php.ini. No problem, copy the php.ini.default > php.ini and use that and add the line

extension= /usr/local/php5-7.1.19-20180625-094435/lib/php/extensions/no-debug-non-zts-20160303/intl.so

$php -i | grep intl
@andyfoote
Copy link

This doesn't work on macOS Catalina and PHP 7.3.11. It's giving an error which references the directory in your extension= line:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5-7.1.19-20180625-094435/lib/php/extensions/no-debug-non-zts-20160303/intl.so' (tried: /usr/local/php5-7.1.19-20180625-094435/lib/php/extensions/no-debug-non-zts-20160303/intl.so (dlopen(/usr/local/php5-7.1.19-20180625-094435/lib/php/extensions/no-debug-non-zts-20160303/intl.so, 0x0009): dlopen(): file not found: /usr/local/php5-7.1.19-20180625-094435/lib/php/extensions/no-debug-non-zts-20160303/intl.so), /usr/lib/php/extensions/no-debug-non-zts-20180731//usr/local/php5-7.1.19-20180625-094435/lib/php/extensions/no-debug-non-zts-20160303/intl.so.so (dlopen(/usr/lib/php/extensions/no-debug-non-zts-20180731//usr/local/php5-7.1.19-20180625-094435/lib/php/extensions/no-debug-non-zts-20160303/intl.so.so, 0x0009): dlopen(): file not found: /usr/lib/php/extensions/no-debug-non-zts-20180731//usr/local/php5-7.1.19-20180625-094435/lib/php/extensions/no-debug-non-zts-20160303/intl.so.so)) in Unknown on line 0

@abumsab
Copy link

abumsab commented Mar 2, 2021

also me I got this

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5-7.3.8-20190811-205217/lib/php/extensions/no-debug-non-zts-20180731/intl.so' (tried: /usr/local/php5-7.3.8-20190811-205217/lib/php/extensions/no-debug-non-zts-20180731/intl.so (dlopen(/usr/local/php5-7.3.8-20190811-205217/lib/php/extensions/no-debug-non-zts-20180731/intl.so, 0x0009): code signature in (/usr/local/php5-7.3.8-20190811-205217/lib/php/extensions/no-debug-non-zts-20180731/intl.so) not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), /usr/lib/php/extensions/no-debug-non-zts-20180731//usr/local/php5-7.3.8-20190811-205217/lib/php/extensions/no-debug-non-zts-20180731/intl.so.so (dlopen(/usr/lib/php/extensions/no-debug-non-zts-20180731//usr/local/php5-7.3.8-20190811-205217/lib/php/extensions/no-debug-non-zts-20180731/intl.so.so, 0x0009): dlopen(): file not found: /usr/lib/php/extensions/no-debug-non-zts-20180731//usr/local/php5-7.3.8-20190811-205217/lib/php/extensions/no-debug-n in Unknown on line 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment