zoukankan      html  css  js  c++  java
  • MAC 下 安装redis 并配置 php redis 扩展

    下载 redis 

    redis-3.1.2.tgz

    sudo tar -xzf redis-3.1.2.tgz

    cd redis-3.1.2

    sudo phpize

    grep: /usr/include/php/main/php.h: No such file or directory
    grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
    grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
    Configuring for:
    PHP Api Version:        
    Zend Module Api No:     
    Zend Extension Api No: 

    find / -name php-config

    /usr/bin/php-config

    sudo ./configure --with-php-config=/usr/bin/php-config

     

    sudo make

    In file included from /Users/anbaojia/redis-3.1.2/redis.c:27:
    ./common.h:1:10: fatal error: 'php.h' file not found
    #include "php.h"
             ^~~~~~~
    1 error generated.
    make: *** [redis.lo] Error 1

    解决方法  我的mac 版本是10.14

    sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include /usr/include

     

    sudo make install

     

    如果报错 

    Permission denied

     

    重启电脑   command+r 进入安全模式   csrutil disable

     

    再重启

    sudo make install  

     

    php -m|grep redis

    redis

    开启 

    redis-server

     

     

     

    php.ihi 

    extension=redis.so

    重启apache

     

     

     

     

     

     

     

     

     

  • 相关阅读:
    CoreAnimation实现一个折线表
    copy和mutableCopy的深、浅拷贝
    寄存器变量
    GCD的一点理解
    Objective c 自动释放池
    iOS xcode 插件安装
    iOS cell 分割线顶格
    手机连接外设蓝牙4.0失败,发送消息失败遇到的问题总结
    svn中第一次check out working copy项目下来出现 ld: library not found for -lcrypto clang: error: linker command failed with exit code 1 (use -v to see invocation)
    ios调用百度地图定位遇到的奇葩问题
  • 原文地址:https://www.cnblogs.com/arvin-an/p/10796687.html
Copyright © 2011-2022 走看看