MAC 下 安裝redis 並配置 php redis 擴展

下載 redis php

redis-3.1.2.tgzredis

sudo tar -xzf redis-3.1.2.tgzapache

cd redis-3.1.2安全

sudo phpizeapp

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-configspa

/usr/bin/php-config

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

 

sudo makeorm

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.14server

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

 

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

相關文章
相關標籤/搜索