Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use homebrew to install phpredis. #1341

Closed
rquadling opened this issue Apr 23, 2018 · 7 comments
Closed

Unable to use homebrew to install phpredis. #1341

rquadling opened this issue Apr 23, 2018 · 7 comments

Comments

@rquadling
Copy link

Homebrew-php is deprecated/deleted/dead as a dodo.
Homebrew-core is now the thing.
brew install php70-redis (or any version) is no longer present.

Whilst it isn't directly phpredis's issue what some third party package manager has done, I'm hoping someone here knows the right magic to install this extension, ideally via homebrew (but not necessary if an easier option is available).

@yatsukhnenko
Copy link
Member

You can always install extension via pecl
pecl install redis
or compile it from scratch :)

@rquadling
Copy link
Author

I realised that once I realised phpredis and pecl/redis are the same. Any reason why the names aren't consistent?

@javorszky
Copy link

javorszky commented Jul 5, 2018

pecl install redis results in this:

Build process completed successfully
Installing '/usr/local/Cellar/php/7.2.7/pecl/20170718/redis.so'

Warning: mkdir(): File exists in System.php on line 294

Warning: mkdir(): File exists in /usr/local/Cellar/php/7.2.7/share/php/pear/System.php on line 294
ERROR: failed to mkdir /usr/local/Cellar/php/7.2.7/pecl/20170718

Solution

Because /usr/local/Cellar/php/7.2.7/pecl is not a directory. It's a symlink to /usr/local/lib/php/pecl

The solution to that is that the pecl that's being used is in /usr/local/Cellar/php/7.2.7/bin/pecl, and not the 7.2.7/pecl file, so that symlink can be removed, and a directory created.

For those who bump into this problem.

Double check which pecl and what that file is pointing to, etc.

@danielbachhuber
Copy link

One issue I ran into is that pecl install redisdumpedextension="redis.so"at the top of myphp.ini`. This was invalid, and gave me an error like this:

Warning: PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/local/lib/php/pecl/20170718/redis.so (dlopen(/usr/local/lib/php/pecl/20170718/redis.so, 9): image not found), /usr/local/lib/php/pecl/20170718/redis.so.so (dlopen(/usr/local/lib/php/pecl/20170718/redis.so.so, 9): image not found)) in Unknown on line 0

I removed the extension="redis.so" line and instead created /usr/local/etc/php/7.2/conf.d/ext-redis.ini with:

extension="/usr/local/Cellar/php/7.2.9_2/pecl/20170718/redis.so"

@blind3dd
Copy link

for me it went like this:
$ wget https://github.com/nicolasff/phpredis/archive/master.zip
(unzip)
$ cd <unzipped_dir>
$ phpize ;./configure ;make ; sudo make install

$ find your php; for me it was /usr/local/etc/php/7.1/conf.d/
$ navigate there and:
cat >> ext-redis.ini << 'AyeCaramba'
extension="/usr/local/Cellar/php@7.1/7.1.25/pecl/20160303/redis.so"
AyeCaramba
$ brew services restart php@7.1

@blind3dd
Copy link

blind3dd commented Nov 6, 2019

version in the above
extension="/usr/local/Cellar/php@7.1/7.1.25/pecl/20160303/redis.so"
may differ to make sure to double check that path.

@mypetertw
Copy link

mypetertw commented Apr 23, 2021

One issue I ran into is that pecl install redisdumpedextension="redis.so"at the top of myphp.ini`. This was invalid, and gave me an error like this:

Warning: PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/local/lib/php/pecl/20170718/redis.so (dlopen(/usr/local/lib/php/pecl/20170718/redis.so, 9): image not found), /usr/local/lib/php/pecl/20170718/redis.so.so (dlopen(/usr/local/lib/php/pecl/20170718/redis.so.so, 9): image not found)) in Unknown on line 0

I removed the extension="redis.so" line and instead created /usr/local/etc/php/7.2/conf.d/ext-redis.ini with:

extension="/usr/local/Cellar/php/7.2.9_2/pecl/20170718/redis.so"

I got the same issue and until I saw this comment and it works.

Default location is totally wrong lol

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

No branches or pull requests

6 participants