搜尋
首頁後端開發php教程php-extension - mac 本機xampp的php redis 擴充安裝失敗

<code>$  /Applications/XAMPP/xamppfiles/bin/phpize-5.4.31 
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525
$ clear

$  /Applications/XAMPP/xamppfiles/bin/phpize-5.4.31 
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525
$ ./configure --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config-5.4.31 
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i386-apple-darwin14.3.0
checking host system type... i386-apple-darwin14.3.0
checking target system type... i386-apple-darwin14.3.0
checking for PHP prefix... /Applications/XAMPP/xamppfiles
checking 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/lib
checking for PHP extension directory... /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20100525
checking for PHP installed headers prefix... /Applications/XAMPP/xamppfiles/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.16 (ok)
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable redis support... yes, shared
checking whether to enable sessions... yes
checking whether to enable igbinary serializer support... no
checking for redis igbinary support... disabled
checking for ld used by cc... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking for /Library/Developer/CommandLineTools/usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin14.3.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
$ sudo make
Password:
/bin/sh /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/libtool --mode=install cp ./redis.la /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/modules
cp ./.libs/redis.so /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/modules/redis.so
cp ./.libs/redis.lai /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/modules/redis.la
----------------------------------------------------------------------
Libraries have been installed in:
   /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify 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 execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

shengyewangluodeMacBook-Air:phpredis shengye$ make test

Build complete.
Don't forget to run 'make test'.

PHP Warning:  PHP Startup: redis: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20100525
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: redis: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20100525
These options need to match
 in Unknown on line 0

=====================================================================
PHP         : /Applications/XAMPP/xamppfiles/bin/php 
Warning: PHP Startup: redis: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20100525
These options need to match
 in Unknown on line 0

PHP_SAPI    : cli
PHP_VERSION : 5.4.31
ZEND_VERSION: 2.4.0
PHP_OS      : Darwin - Darwin shengyewangluodeMacBook-Air.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
INI actual  : /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/tmp-php.ini
More .INIs  :  
CWD         : /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis
Extra dirs  : 
VALGRIND    : Not used
=====================================================================
TIME START 2016-09-20 04:52:42
=====================================================================
No tests were run.
shengyewangluodeMacBook-Air:phpredis shengye$ sudo make install
Installing shared extensions:     /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20100525/
shengyewangluodeMacBook-Air:phpredis shengye$ sudo make install
/bin/sh /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/libtool --mode=install cp ./redis.la /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/modules
cp ./.libs/redis.so /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/modules/redis.so
cp ./.libs/redis.lai /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/modules/redis.la
----------------------------------------------------------------------
Libraries have been installed in:
   /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify 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 execution

See any operating system documentation about shared libraries for
more 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-20100525/

$ /Applications/XAMPP/bin/php -m |grep redis
PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20100525/ffmpeg.so' - dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20100525/ffmpeg.so, 9): image not found in Unknown on line 0
PHP Warning:  PHP Startup: redis: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20100525
These options need to match
 in Unknown on line 0
Warning: PHP Startup: redis: Unable to initialize module
</code>

寶寶的擴充安裝從來都沒有成功過,這是為什麼?求高人賜教

之前也安裝過ffmpeg和imagick都沒有成功,非常耽誤進度。 。求高手賜教

回覆內容:

<code>$  /Applications/XAMPP/xamppfiles/bin/phpize-5.4.31 
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525
$ clear

$  /Applications/XAMPP/xamppfiles/bin/phpize-5.4.31 
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525
$ ./configure --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config-5.4.31 
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i386-apple-darwin14.3.0
checking host system type... i386-apple-darwin14.3.0
checking target system type... i386-apple-darwin14.3.0
checking for PHP prefix... /Applications/XAMPP/xamppfiles
checking 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/lib
checking for PHP extension directory... /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20100525
checking for PHP installed headers prefix... /Applications/XAMPP/xamppfiles/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.16 (ok)
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable redis support... yes, shared
checking whether to enable sessions... yes
checking whether to enable igbinary serializer support... no
checking for redis igbinary support... disabled
checking for ld used by cc... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking for /Library/Developer/CommandLineTools/usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin14.3.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
$ sudo make
Password:
/bin/sh /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/libtool --mode=install cp ./redis.la /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/modules
cp ./.libs/redis.so /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/modules/redis.so
cp ./.libs/redis.lai /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/modules/redis.la
----------------------------------------------------------------------
Libraries have been installed in:
   /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify 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 execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

shengyewangluodeMacBook-Air:phpredis shengye$ make test

Build complete.
Don't forget to run 'make test'.

PHP Warning:  PHP Startup: redis: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20100525
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: redis: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20100525
These options need to match
 in Unknown on line 0

=====================================================================
PHP         : /Applications/XAMPP/xamppfiles/bin/php 
Warning: PHP Startup: redis: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20100525
These options need to match
 in Unknown on line 0

PHP_SAPI    : cli
PHP_VERSION : 5.4.31
ZEND_VERSION: 2.4.0
PHP_OS      : Darwin - Darwin shengyewangluodeMacBook-Air.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
INI actual  : /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/tmp-php.ini
More .INIs  :  
CWD         : /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis
Extra dirs  : 
VALGRIND    : Not used
=====================================================================
TIME START 2016-09-20 04:52:42
=====================================================================
No tests were run.
shengyewangluodeMacBook-Air:phpredis shengye$ sudo make install
Installing shared extensions:     /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20100525/
shengyewangluodeMacBook-Air:phpredis shengye$ sudo make install
/bin/sh /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/libtool --mode=install cp ./redis.la /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/modules
cp ./.libs/redis.so /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/modules/redis.so
cp ./.libs/redis.lai /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/modules/redis.la
----------------------------------------------------------------------
Libraries have been installed in:
   /Applications/XAMPP/xamppfiles/htdocs/redis/phpredis/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify 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 execution

See any operating system documentation about shared libraries for
more 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-20100525/

$ /Applications/XAMPP/bin/php -m |grep redis
PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20100525/ffmpeg.so' - dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20100525/ffmpeg.so, 9): image not found in Unknown on line 0
PHP Warning:  PHP Startup: redis: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20100525
These options need to match
 in Unknown on line 0
Warning: PHP Startup: redis: Unable to initialize module
</code>

寶寶的擴充安裝從來都沒有成功過,這是為什麼?求高人賜教

之前也安裝過ffmpeg和imagick都沒有成功,非常耽誤進度。 。求高手賜教

終於搞定了! ! !

直接用pecl安裝,就好了。 。 redis3.0.0不支援php7以下的。 。 。都是坑

<code>sudo /Applications/XAMPP/xamppfiles/bin/pecl install redis-2.2.8</code>

都用homebrew搭環境吧

先確認下 /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20100525/這個目錄有沒有redis.so等檔案

再確認下有沒有php.ini有沒有增加動態模組的配置,extension=redis.so多個就多行

你沒有make install?

陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
PHP與Python:了解差異PHP與Python:了解差異Apr 11, 2025 am 12:15 AM

PHP和Python各有優勢,選擇應基於項目需求。 1.PHP適合web開發,語法簡單,執行效率高。 2.Python適用於數據科學和機器學習,語法簡潔,庫豐富。

php:死亡還是簡單地適應?php:死亡還是簡單地適應?Apr 11, 2025 am 12:13 AM

PHP不是在消亡,而是在不斷適應和進化。 1)PHP從1994年起經歷多次版本迭代,適應新技術趨勢。 2)目前廣泛應用於電子商務、內容管理系統等領域。 3)PHP8引入JIT編譯器等功能,提升性能和現代化。 4)使用OPcache和遵循PSR-12標準可優化性能和代碼質量。

PHP的未來:改編和創新PHP的未來:改編和創新Apr 11, 2025 am 12:01 AM

PHP的未來將通過適應新技術趨勢和引入創新特性來實現:1)適應云計算、容器化和微服務架構,支持Docker和Kubernetes;2)引入JIT編譯器和枚舉類型,提升性能和數據處理效率;3)持續優化性能和推廣最佳實踐。

您什麼時候使用特質與PHP中的抽像類或接口?您什麼時候使用特質與PHP中的抽像類或接口?Apr 10, 2025 am 09:39 AM

在PHP中,trait適用於需要方法復用但不適合使用繼承的情況。 1)trait允許在類中復用方法,避免多重繼承複雜性。 2)使用trait時需注意方法衝突,可通過insteadof和as關鍵字解決。 3)應避免過度使用trait,保持其單一職責,以優化性能和提高代碼可維護性。

什麼是依賴性注入容器(DIC),為什麼在PHP中使用一個?什麼是依賴性注入容器(DIC),為什麼在PHP中使用一個?Apr 10, 2025 am 09:38 AM

依賴注入容器(DIC)是一種管理和提供對象依賴關係的工具,用於PHP項目中。 DIC的主要好處包括:1.解耦,使組件獨立,代碼易維護和測試;2.靈活性,易替換或修改依賴關係;3.可測試性,方便注入mock對象進行單元測試。

與常規PHP陣列相比,解釋SPL SplfixedArray及其性能特徵。與常規PHP陣列相比,解釋SPL SplfixedArray及其性能特徵。Apr 10, 2025 am 09:37 AM

SplFixedArray在PHP中是一種固定大小的數組,適用於需要高性能和低內存使用量的場景。 1)它在創建時需指定大小,避免動態調整帶來的開銷。 2)基於C語言數組,直接操作內存,訪問速度快。 3)適合大規模數據處理和內存敏感環境,但需謹慎使用,因其大小固定。

PHP如何安全地上載文件?PHP如何安全地上載文件?Apr 10, 2025 am 09:37 AM

PHP通過$\_FILES變量處理文件上傳,確保安全性的方法包括:1.檢查上傳錯誤,2.驗證文件類型和大小,3.防止文件覆蓋,4.移動文件到永久存儲位置。

什麼是無效的合併操作員(??)和無效分配運算符(?? =)?什麼是無效的合併操作員(??)和無效分配運算符(?? =)?Apr 10, 2025 am 09:33 AM

JavaScript中處理空值可以使用NullCoalescingOperator(??)和NullCoalescingAssignmentOperator(??=)。 1.??返回第一個非null或非undefined的操作數。 2.??=將變量賦值為右操作數的值,但前提是該變量為null或undefined。這些操作符簡化了代碼邏輯,提高了可讀性和性能。

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您聽不到任何人,如何修復音頻
3 週前By尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解鎖Myrise中的所有內容
3 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

將Eclipse與SAP NetWeaver應用伺服器整合。