How to install php-redis extension on mac os 10.13?
Asked Answered
C

2

7

For a few days I'm trying to install php-redis extension.

Try use brew and getting this...

$ brew install php71-redis
Error: No available formula with the name "php71-redis" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

Trying to install with PECL and getting this...

    $ sudo pecl install redis
    downloading redis-4.1.0.tgz ...
    Starting to download redis-4.1.0.tgz (220,774 bytes)
    ..............................................done: 220,774 bytes
    25 source files, building
    running: phpize
    Configuring for:
    PHP Api Version:         20160303
    Zend Module Api No:      20160303
    Zend Extension Api No:   320160303
   ************

   ************
    checking whether to enable igbinary serializer support... yes
    checking whether to enable lzf compression... yes
    checking use system liblzf... no
    checking for igbinary includes... configure: error: Cannot find igbinary.h
    ERROR: `/private/tmp/pear/install/redis/configure --with-php-config=/usr/bin/php-config --enable-redis-igbinary=нуы --enable-redis-lzf=yes' failed

and finally trying to install igbinary.h ....

$ sudo pecl install igbinary
downloading igbinary-2.0.7.tgz ...
Starting to download igbinary-2.0.7.tgz (73,523 bytes)

   ************

   ************


Build process completed successfully
Installing '/usr/include/php/ext/igbinary/igbinary.h'
ERROR: failed to mkdir /usr/include/php/ext/igbinary
Charge answered 12/7, 2018 at 13:44 Comment(1)
I think you are maybe falling foul of System Integrity Protection by trying to create /usr/include/php/ext/igbinary, see support.apple.com/en-us/ht204899 Maybe you can somehow install just for yourself in your HOME directories instead of in system directories for all users? Sorry, I do not know pecl that well.Prepositive
D
7

I just did this on Mac OS 10.13 (I'm still using High Sierra).

With homebrew php7.2 and up, pecl is now installed by default alongside the php binaries.

To see this for yourself type which pecl.

Steps to install

  1. Check your version of redis, then find a suitable version of the extension here.

  2. If unfamiliar with pecl, type pecl to see the options.

  3. Issue pecl install redis 5.0.2. (or your version). Enter no to each question asked if you're not sure.

  4. If that succeeds check the new file it created at: /usr/local/lib/php/pecl/20180731/redis.so

  5. The install will have added extension="redis.so" to top of your php ini. Check that by opening the file /usr/local/etc/php/7.3/php.ini. (assuming you're on 7.3 there)

  6. brew services restart php.

  7. php -i | grep Redis

Redis Support => enabled
Redis Version => 5.0.2

Did this in September 2019 and it works for me.

Derisible answered 3/10, 2019 at 13:21 Comment(0)
M
0

For this, try to disable the csrutil on OSx (Mac):

  1. Reboot your Mac
  2. When the Mac starts, typo Command + R until you get into recovery mode
  3. In the recovery mode, go to utilities and select terminal
  4. in the terminal type csrutil disable
  5. Reboot your mac and redo the redis install by pecl

Should work.

Manofwar answered 31/8, 2018 at 7:21 Comment(2)
I think you mean Mac en.m.wikipedia.org/wiki/Macintosh rather than MAC en.m.wikipedia.org/wiki/MAC_addressPrepositive
Hi Mark, you're right, I edited my reply. But easy to guess it regarding the title of this questonManofwar

© 2022 - 2024 — McMap. All rights reserved.