How do I enable php-intl on Local?

Another +1 for progress on this. @clay (or anyone from the team): any news?

Hey everyone, thanks for your patience with this!

I wish I had a solution for you right now, but Iā€™ve been cracking at this for a bit now and havenā€™t been able to get the intl extension to build for MacOS. From what I can tell, it seems like intl is no longer compiled as a separate extension, and instead, needs to be compiled when building php itself.

Iā€™m working with the Local team to get this extension compiled when building PHP itself, but I donā€™t have an exact time for when this will be ready.

If anyone is curious about the general workflow for what was tried, here we go:


  1. Right-click on the site you wish to install the extension for and ā€œOpen Site Shell.ā€

  2. Download and untar extension from PECL - https://pecl.php.net/package/intl

  3. Change to the extension directory

    cd ~/Downloads/intl-3.0.0/intl-3.0.0
    
  4. Update prefix in phpize and php-config to point to the php that is bundled with Local. This path would look something like:

    /Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-7.3.5+10/bin/darwin/
    
  5. Run phpize

  6. Run ./configure

    • Check for missing dependencies.
    • This seemed to be fixed with brew install intltool icu4c gettext
    • Then adding echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.zshrc this to the shell environment
  7. Run make, which results in errors similar to: PHP :: Bug #72879 :: Pecl install intl make error with PHP 7.0.8

From here, I went to see what others in the space are doing, and at least with Homebrewā€™s php@7.4 formula, they are compiling php with a specific extension:

3 Likes

Thanks for the update, @ben.turner!

Itā€™s a bummer to hear itā€™s a rather complicated process. Please post if youā€™re able to even find a workaround such as directing Local to use a compiled version of PHP with Intl included.

Looking forward to further updates as they come in!

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

+1 to see if thereā€™s any update on how to enable Intl extension on mac?

With latest Wordpress is even flagged in the Site Health screen - Screenshot by Lightshot

+1 for Mac

I didnā€™t see an existing feature request (my apologies if I missed it), so I went ahead and created one here. Compile PHP with the `intl` extension. This will allow the community to upvote for it.

That said, it is clear this is important to a large number of users. I will work on getting this prioritized with the development team.

Hi,
my folder is /Users//Library/Application\ Support/Local/lightning-services/php-7.3.5+11/bin/darwin/
but when run phpize /Users/
*/Library/Application\ Support/Local/lightning-services/php-7.3.5+11/bin/darwin/ view this error:
Cannot find build files at ā€˜/Users/runner/work/_temp/local-lightning-php/php-7.3.5/build/lib/php/buildā€™. Please check your PHP installation.
why?

Itā€™s because your machine likely doesnā€™t have the same folder structure as our build machine ā€“ note the url that was mentioned:

/Users/runner/work/_temp/l....

In any case, we recently improved our PHP lighting services and included the intl extension. See the solved feature request for more details:

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.