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

     

     

     

     

     

     

     

     

     

  • 相关阅读:
    java实现动态上传多个文件并解决文件重名问题
    MySQL存储过程之事务管理
    Java IO--字符流--InputStreamReader 和 OutputStreamWriter
    Java IO--字符流--BufferedReader和BufferedWriter
    java线程同步小结
    进程和线程的区别与联系
    java中“==”和equals方法的区别,再加上特殊的String引用类型
    java.util.Date 与 java.sql.Date 之间的转换
    Java Applet 与Servlet之间的通信
    Applet 应用程序进行数字签名,对系统文件进行读写操作
  • 原文地址:https://www.cnblogs.com/arvin-an/p/10796687.html
Copyright © 2011-2022 走看看