下载swoole扩展逐渐,附件:
github地址:https://github.com/swoole/swoole-src.git
安装swoole:
cd swoole-src-master /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config make install cd ..
安装成功时,会提示:
Libraries have been installed in: /root/swoole-src-master/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 `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,--rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' 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: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
编译安装完后,修改php.ini加入extension=swoole.so开启swoole扩展。也可以通过dl('swoole.so')动态载入,推荐修改php.ini