Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

'Library not loaded' for PHP@7.1 #24

Closed
patrik-csak opened this issue Apr 24, 2020 · 10 comments
Closed

'Library not loaded' for PHP@7.1 #24

patrik-csak opened this issue Apr 24, 2020 · 10 comments

Comments

@patrik-csak
Copy link

$ brew install php@7.1  
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
rswift

==> Installing php@7.1 from exolnet/deprecated
==> Downloading https://dl.bintray.com/exolnet/bottles-deprecated/php@7.1-7.1.33.catalina.bottle.1.tar.gz
Already downloaded: /Users/pcsak/Library/Caches/Homebrew/downloads/6f7cea0ee1be0bf57615a586b5e151baf5e1b0ec13aa32ac75ce33fae1501023--php@7.1-7.1.33.catalina.bottle.1.tar.gz
==> Pouring php@7.1-7.1.33.catalina.bottle.1.tar.gz
==> /usr/local/Cellar/php@7.1/7.1.33/bin/pear config-set php_ini /usr/local/etc/php/7.1/php.ini system
Last 15 lines from /Users/pcsak/Library/Logs/Homebrew/php@7.1/post_install.01.pear:
2020-04-24 10:59:31 -0400

/usr/local/Cellar/php@7.1/7.1.33/bin/pear
config-set
php_ini
/usr/local/etc/php/7.1/php.ini
system

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.64.dylib
  Referenced from: /usr/local/Cellar/php@7.1/7.1.33/bin/php
  Reason: image not found
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall exolnet/deprecated/php@7.1`
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php7_module /usr/local/opt/php@7.1/lib/httpd/modules/libphp7.so

    <FilesMatch \.php$>
        SetHandler application/x-httpd-php
    </FilesMatch>

Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /usr/local/etc/php/7.1/

php@7.1 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have php@7.1 first in your PATH run:
  echo 'export PATH="/usr/local/opt/php@7.1/bin:$PATH"' >> ~/.zshrc
  echo 'export PATH="/usr/local/opt/php@7.1/sbin:$PATH"' >> ~/.zshrc

For compilers to find php@7.1 you may need to set:
  export LDFLAGS="-L/usr/local/opt/php@7.1/lib"
  export CPPFLAGS="-I/usr/local/opt/php@7.1/include"


To have launchd start exolnet/deprecated/php@7.1 now and restart at login:
  brew services start exolnet/deprecated/php@7.1
Or, if you don't want/need a background service you can just run:
  php-fpm
==> Summary
🍺  /usr/local/Cellar/php@7.1/7.1.33: 514 files, 62.9MB
@janmaarten
Copy link

janmaarten commented Apr 26, 2020

For now, this seems linked to what was fixed here earlier for 5.6 and 7.0: the ICU4C-64 is needed for 7.1, whereas 7.2 and up from homebrew seem to be using ICU4C-66. I seem to be able to fix this by running the following after switching to php@7.1:

brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/a806a621ed3722fb580a58000fb274a2f2d86a6d/Formula/icu4c.rb

This fetches the 64 version from raw github. Not sure what happens to node or other linked dependencies though.

If you want to go back to the supported version by homebrew (for 7.2+):

brew upgrade icu4c.

@JParkinson1991
Copy link

@ptrkcsk I've been running into the same sort of issues today due to updates with openssl and icu4c.

Looking into this reinstall php@7.1 from source seems to fix the issues.

$ brew list --versions icu4c
icu4c 66.1

$ brew list --versions openssl
openssl@1.1 1.1.1g

$ brew reinstall --build-from-source php@7.1

$ php -v
PHP 7.1.33 (cli) (built: Apr 27 2020 10:02:25) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.33, Copyright (c) 1999-2018, by Zend Technologies

Strongly recommended to make sure you have the current versions of both icu4c and openssl before rebuilding the package from source.

@patrik-csak
Copy link
Author

Thanks, @JParkinson1991 !

--build-from-source fixed it.

@janmaarten
Copy link

Thanks @JParkinson1991 this fixed it.

@micmek
Copy link

micmek commented Jun 4, 2020

Thanks @JParkinson1991
Running that command:
brew reinstall --build-from-source php@7.1 fixed it :)

@nthsky
Copy link

nthsky commented Jun 9, 2020

@JParkinson1991 Thanks,it works

@svrl
Copy link

svrl commented Jun 15, 2020

@JParkinson1991 thank you.

@claudiu-cristea
Copy link

I was trying to rebuild from source, as @JParkinson1991 suggested in #24 (comment) but I'm getting the error from #27. Any idea why?

@pgrenaud
Copy link
Contributor

Hi!

Thank you for your interest in this repository. Unfortunately, this repository will now be archived with no further actions. We are sorry for the inconvenience.

Why are we closing this repository? This repository was only meant as a temporary measure, not a permanent one. Its only purpose was to ease the transition, considering that formulae from the homebrew-core tap are removed almost the day they became unsupported by the vendor. We needed a few more months to allow us to upgrade the code base of the various projects we have. But it was always with the intention of doing those upgrades, not by relying on a repository to keep old php versions artificially alive. We do not condone the use of deprecated software that could lead to serious security vulnerabilities.

Why are we not redirecting to another repository? Redirecting to another repository could be interpreted as an endorsement of said repository. If we were to do such a thing, we would not do it without vetting it first. And we do not wish to put the time and energy required in a vetting process of a third party repository. As the reason why a vetting process would be required, consider this. Before installing a software library on all our developer computers from an untrusted source, we would need to make sure that this software library is free from any malicious code (Trojan, ransomware, etc.), both in the repository itself and in the packaged binaries (the homebrew bottles, if any).

Thank you for your understanding.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants