0

I'm developing in a project which explicitly requires PHP 7.2. I have to use brew tap shivammathur/php to get php@7.2 to install.

However, when I try to switch to composer v1 (another unfortunate requirement) using composer self-update --1 I get this error:

dyld: Library not loaded: /usr/local/opt/openldap/lib/libldap-2.5.0.dylib
Referenced from: /usr/local/bin/php
Reason: image not found

Fixing this should be easy by just running brew reinstall openldap libiconv but when I run that it then tries to remove PHP 7.2 and force install PHP 7.4:

==> Upgrading php@7.4
  -> 7.4.27

That of course breaks the project, requiring me to again reinstall PHP 7.2 manually which then breaks openldap and libiconv which forces a reinstall of those and then I am back where I started with them trying to install PHP 7.4.

How do I get PHP 7.2 to start working on my system with these circular dependency upgrades happening that I don't want?

eComEvo
  • 10,695
  • 22
  • 82
  • 132
  • The dependencies are not circular, it is just that brew updates the dependent packages as well when a library is updated unless you pin the dependent package. You can run `brew link --force --overwrite php@7.2` to switch back to PHP 7.2 – Shivam Mathur Jan 11 '22 at 03:48

0 Answers0