Search code examples
phpcakephpcakephp-3.x

Install CakePHP on OS X w/ Composer Fails, lib-icu ^62.1 has the wrong version installed


I am trying to add a package via composer on OS X to my CakePHP Application...

└──╼ composer require nbobtc/bitcoind-php
Using version ^2.1 for nbobtc/bitcoind-php
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
- The requested linked library lib-icu ^62.1 has the wrong version installed, try upgrading the intl extension.

I have installed php 7.3 with brew install [email protected] and linked with brew link [email protected] --force

└──╼ php --version
PHP 7.3.9 (cli) (built: Sep  8 2019 14:56:33) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.9, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.9, Copyright (c) 1999-2018, by Zend Technologies

I have the intl extension installed...

└──╼ php -m | grep intl
intl

I have the icu4c library installed

└──╼ brew install icu4c

Warning: icu4c 64.2 is already installed and up-to-date

I have also linked the icu4c library

 └──╼ brew link icu4c --force

How can I upgrade the intl package?


Solution

  • i've had a similar problem with intl, icu, composer and cake. it's not simple but i think i could help you with some information.

    First, I think you have composer ponting to native php, not that one installed with homebrew, because of that you still getting this wrong version of icu.

    Second, i wanted to use native php and apache that came with macOS Mojave. Besides official php site informs that intl, since PHP 5.3.0, it's bundled with PHP.

    But, it's missing on native instalation of PHP 7.1.24 on Mac OS Mojave.

    Then i downloaded PHP 7.1 from php.net, installed XCode Command Line Tools, ICU (http://site.icu-project.org/), Autoconf, reinstalled the developer tools header files, and finally installed Intl extension using phpize.

    Important: you'll have to disable SIP. Let me know if worked for you, ok?