下載swoole安裝包:https://github.com/swoole/swoole-src/releases
執(zhí)行phpize命令
sudo /Applications/MAMP/bin/php/php7.0.19/bin/phpize
執(zhí)行configure可執(zhí)行文件。
./configure --with-php-config=/Applications/MAMP/bin/php/php7.0.19/bin/php-config
編譯安裝
make install
發(fā)現(xiàn)報(bào)錯(cuò),原因是文件缺少韧骗。需要從xcode中的php目錄下去拷貝.php文件到mamp pro中的php目錄心肪,什么目錄卻什么文件就拷貝什么文件
/Applications/MAMP/bin/php/php7.0.19/include/php/Zend/zend_portability.h:48:11: fatal error:
'zend_config.h' file not found
# include <zend_config.h>
————————————————————
主要目錄路徑:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php
/Applications/MAMP/bin/php/php7.0.19/include/php/Zend
安裝成功
creating swoole.la
(cd .libs && rm -f swoole.la && ln -s ../swoole.la swoole.la)
/bin/sh /Users/air/Documents/swoole4.2/libtool --mode=install cp ./swoole.la /Users/air/Documents/swoole4.2/modules
cp ./.libs/swoole.so /Users/air/Documents/swoole4.2/modules/swoole.so
cp ./.libs/swoole.lai /Users/air/Documents/swoole4.2/modules/swoole.la
----------------------------------------------------------------------
Libraries have been installed in:
/Users/air/Documents/swoole4.2/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/MAMP/bin/php/php7.0.19/lib/php/extensions/no-debug-non-zts-20151012/
Installing header files: /Applications/MAMP/bin/php/php7.0.19/include/php/
開啟swoole拓展开缎,并重啟服務(wù)
在php.ini文件中添加: extension=swoole.so
redis安裝成功
dsymutil .libs/redis.so || :
creating redis.la
(cd .libs && rm -f redis.la && ln -s ../redis.la redis.la)
/bin/sh /Users/air/Documents/phpredis/libtool --mode=install cp ./redis.la /Users/air/Documents/phpredis/modules
cp ./.libs/redis.so /Users/air/Documents/phpredis/modules/redis.so
cp ./.libs/redis.lai /Users/air/Documents/phpredis/modules/redis.la
----------------------------------------------------------------------
Libraries have been installed in:
/Users/air/Documents/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/MAMP/bin/php/php7.0.19/lib/php/extensions/no-debug-non-zts-20151012/