首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在mac 10.13上安装php-redis扩展?

如何在mac 10.13上安装php-redis扩展?
EN

Stack Overflow用户
提问于 2018-07-12 13:44:50
回答 2查看 6.5K关注 0票数 7

几天来,我一直在尝试安装php扩展。

试着用啤酒拿这个..。

代码语言:javascript
复制
$ 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.

尝试用PECL安装然后得到这个..。

代码语言:javascript
复制
    $ 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

最后试图安装igbinary.h ..。

代码语言:javascript
复制
$ 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
EN

回答 2

Stack Overflow用户

发布于 2019-10-03 13:21:41

我刚在MacOS10.13上做了这个(我还在使用)。

有了自制php7.2和更高版本,现在默认情况下,pecl与php二进制文件一起安装。

要查看这一点,请输入which pecl

安装的步骤

  1. 检查您的redis版本,然后找到一个合适的扩展这里版本。
  2. 如果不熟悉pecl,请键入pecl以查看选项。
  3. 发布pecl install redis 5.0.2。(或你的版本)。如果您不确定,请对每个问题输入“否”。
  4. 如果成功,请检查它在:/usr/local/lib/php/pecl/20180731/redis.so中创建的新文件
  5. 安装将将extension="redis.so"添加到php的顶部。通过打开文件/usr/local/etc/php/7.3/php.ini来检查这一点。(假设你在7.3级)
  6. brew services restart php
  7. php -i | grep Redis
代码语言:javascript
复制
Redis Support => enabled
Redis Version => 5.0.2

这是在2019年9月做的,对我来说很管用。

票数 7
EN

Stack Overflow用户

发布于 2018-08-31 07:21:33

为此,请尝试禁用OSx (Mac)上的csrutil:

  1. 重新启动你的Mac
  2. 当Mac启动时,输入命令+R,直到进入恢复模式
  3. 在恢复模式中,转到实用程序并选择终端。
  4. 在终端类型csrutil disable
  5. 重新启动您的mac并通过pecl重新安装redis。

应该行得通。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51307311

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档