MAC下PHP拓展Redis插件
来源:互联网 发布:全能行证券交易软件 编辑:程序博客网 时间:2024/06/07 23:37
下载安装phpredis拓展
github下载phpredis拓展项目:
git clone https://github.com/phpredis/phpredis.git
或下载稳定版本:
http://pecl.php.net/package/redis
解压(稳定版):
bogon:~ Brave$ tar xzf redis-3.1.4.tgz
cd 到redis-3.1.4目录下
bogon:~ Brave$ cd redis-3.1.4
执行sudo /Applications/XAMPP/xamppfiles/bin/phpize
bogon:redis-3.1.4 Brave$ sudo /Applications/XAMPP/xamppfiles/bin/phpizePassword:Configuring for:PHP Api Version: 20131106Zend Module Api No: 20131226Zend Extension Api No: 220131226Cannot find autoconf. Please check your autoconf installation and the$PHP_AUTOCONF environment variable. Then, rerun this script.
安装遇到问题:$PHP_AUTOCONF environment variable. Then, rerun this script.
Error: Could not link:/usr/local/share/doc/homebrewPlease delete these paths and run `brew update`./usr/local/Homebrew/Library/Homebrew/brew.rb:12:in `<main>': Homebrew must be run under Ruby 2.3! You're running 2.0.0. (RuntimeError)
删除/usr/local/share/doc/homebrew,重新更新brew
bogon:~ Brave$ brew updateUpdated 1 tap (homebrew/core).==> Updated Formulaeabcm2ps bacula-fd gitlab-runner lldpd tippecanoearmadillo bmake kompose remake zimg
安装autoconf,提示缺少xcode-select
bogon:~ Brave$ brew install autoconfError: Xcode alone is not sufficient on Yosemite.Install the Command Line Tools: xcode-select --install
安装xcode-select –install,弹出Xcode,等待安装完成
再次安装autoconf:
bogon:~ Brave$ brew install autoconfUpdating Homebrew...==> Auto-updated Homebrew!Updated 1 tap (homebrew/core).==> Updated Formulaeclhep firebase-cli fonttools ibex iso-codes==> Downloading https://homebrew.bintray.com/bottles/autoconf-2.69.yosemite.bott######################################################################## 100.0%==> Pouring autoconf-2.69.yosemite.bottle.4.tar.gz
再次sudo /Applications/XAMPP/xamppfiles/bin/phpize
bogon:~ Brave$ cd redis-3.1.4bogon:redis-3.1.4 Brave$ sudo /Applications/XAMPP/xamppfiles/bin/phpizePassword:Configuring for:PHP Api Version: 20131106Zend Module Api No: 20131226Zend Extension Api No: 220131226
运行./configure -with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config
bogon:redis-3.1.4 Brave$ ./configure -with-php-config=/Applications/XAMPP/xamppfiles/bin/php-configchecking for grep that handles long lines and -e... /usr/bin/grepchecking for egrep... /usr/bin/grep -Echecking for a sed that does not truncate output... /usr/bin/sedchecking for cc... ccchecking whether the C compiler works... yeschecking for C compiler default output file name... a.outchecking for suffix of executables... checking whether we are cross compiling... nochecking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether cc accepts -g... yeschecking for cc option to accept ISO C89... none neededchecking how to run the C preprocessor... cc -Echecking for icc... nochecking for suncc... nochecking whether cc understands -c and -o together... yeschecking for system library directory... libchecking if compiler supports -R... nochecking if compiler supports -Wl,-rpath,... yeschecking build system type... x86_64-apple-darwin14.5.0checking host system type... x86_64-apple-darwin14.5.0checking target system type... x86_64-apple-darwin14.5.0checking for PHP prefix... /Applications/XAMPP/xamppfileschecking for PHP includes... -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/libchecking for PHP extension directory... /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226checking for PHP installed headers prefix... /Applications/XAMPP/xamppfiles/include/phpchecking if debug is enabled... nochecking if zts is enabled... nochecking for re2c... noconfigure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.checking for gawk... nochecking for nawk... nochecking for awk... awkchecking if awk is broken... nochecking whether to enable redis support... yes, sharedchecking whether to enable sessions... yeschecking whether to enable igbinary serializer support... nochecking for redis igbinary support... disabledchecking for ld used by cc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ldchecking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... nochecking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -rchecking for BSD-compatible nm... /usr/bin/nmchecking whether ln -s works... yeschecking how to recognize dependent libraries... pass_allchecking for ANSI C header files... yeschecking for sys/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking dlfcn.h usability... yeschecking dlfcn.h presence... yeschecking for dlfcn.h... yeschecking the maximum length of command line arguments... 196608checking command to parse /usr/bin/nm output from cc object... okchecking for objdir... .libschecking for ar... archecking for ranlib... ranlibchecking for strip... stripchecking for dsymutil... dsymutilchecking for nmedit... nmeditchecking for -single_module linker flag... yeschecking for -exported_symbols_list linker flag... yeschecking if cc supports -fno-rtti -fno-exceptions... yeschecking for cc option to produce PIC... -fno-commonchecking if cc PIC flag -fno-common works... yeschecking if cc static flag -static works... nochecking if cc supports -c -o file.o... yeschecking whether the cc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yeschecking dynamic linker characteristics... darwin14.5.0 dyldchecking how to hardcode library paths into programs... immediatechecking whether stripping libraries is possible... yeschecking if libtool supports shared libraries... yeschecking whether to build shared libraries... yeschecking whether to build static libraries... nocreating libtoolappending configuration tag "CXX" to libtoolconfigure: creating ./config.statusconfig.status: creating config.h
编译make & make install
可能会出现错误:
make: *** [redis.la] Error 1bogon:redis-3.1.4 Brave$ libtool: link: `redis_session.lo' is not a valid libtool object
make clean一下
bogon:redis-3.1.4 Brave$ make cleanfind . -name \*.gcno -o -name \*.gcda | xargs rm -ffind . -name \*.lo -o -name \*.o | xargs rm -ffind . -name \*.la -o -name \*.a | xargs rm -f find . -name \*.so | xargs rm -ffind . -name .libs -a -type d|xargs rm -rfrm -f libphp.la modules/* libs/*[1]+ Exit 2 make
重新编译sudo make install
/bin/sh /Users/Brave/redis-3.1.4/libtool --mode=install cp ./redis.la /Users/Brave/redis-3.1.4/modulescp ./.libs/redis.so /Users/Brave/redis-3.1.4/modules/redis.socp ./.libs/redis.lai /Users/Brave/redis-3.1.4/modules/redis.la----------------------------------------------------------------------Libraries have been installed in: /Users/Brave/redis-3.1.4/modulesIf you ever happen to want to link against installed librariesin a given directory, LIBDIR, you must either use libtool, andspecify the full pathname of the library, or use the `-LLIBDIR'flag during linking and do at least one of the following: - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable during executionSee any operating system documentation about shared libraries formore information, such as the ld(1) and ld.so(8) manual pages.----------------------------------------------------------------------Installing shared extensions: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226/
此时/Users/Brave/redis-3.1.4/modules下的redis.so已复制到
/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226/中
配置Php.ini
进入phpinfo页面找到Xampp下的php.ini位置
打开php.ini添加redis拓展配置
extension="redis.so"
重新启动Xampp,访问phpinfo查看redis插件
phpinfo页面出现redis插件信息显示,说明redis插件安装成功
- MAC下PHP拓展Redis插件
- Windows下安装Redis及php的redis拓展教程
- Mac系统MAMP环境下php7安装redis.so拓展
- mac下安装php-redis扩展
- mac下安装php-redis扩展
- mac下安装 php mongo redis 扩展
- MAC下 Redis php扩展安装
- mac下安装php-redis扩展
- mac下安装php-redis扩展
- mac下XAMPP安装php redis扩展
- 给php安装redis拓展
- window 下PHP redis扩展插件
- ubuntu下安装redis拓展、windows下安装redis拓展
- windows下redis的安装配置,整合php拓展详细教程
- CentOS 下,PHP安装拓展
- windows安装redis和php拓展
- Mac os10.10 下php redis 的安装
- 【Real】Mac 环境下安装 Php Redis 扩展
- 关于android中应用内存优化实践
- 第四章 Shell流程控制
- js中json使用心得
- 设计模式之十一种行为型模式(附实例和详解)
- tcpdump抓包
- MAC下PHP拓展Redis插件
- LeetCode.636 Exclusive Time of Functions
- Windows下Git多账号配置,同一电脑多个ssh-key的管理
- 优达机器学习:评估指标
- 如何用ssh隧道绕过防火墙
- Spring Boot 配置Druid监控以及基本特征监测使用
- 内存泄漏的检测
- Appium学习笔记
- Quartz中任意值*与不指定值?的区别