首页 关于 归档

安装php swoole

安装php swoole

# 下载省略
➜ cd swoole-v1.8.7
➜ /usr/local/php/bin/phpize
➜ ./configure --with-php-config=/usr/local/php/bin/php-config
➜ make
➜ make install

#修改/usr/local/php/etc/php.ini
#新增
extension=swoole.so

#查看
➜ /usr/local/php/bin/php -m | grep swoole

# 如果不好彩,可能会遇到的问题 
#PHP Warning:  PHP Startup: Unable to load dynamic library 
# '/usr/local/php-7/lib/php/extensions/no-debug-non-zts-20151012/swoole.so' 
# - /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /usr/local/php-7/lib/php/extensions/no-debug-non-zts-20151012/swoole.so) 
#in Unknown on line 0

#这样的话
#就需要安装GLIBC_2.14
➜ wget http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
➜ cd glibc-2.14
➜ mkdir build
➜ cd build
➜ ../configure --prefix=/usr/local/glibc-2.14
➜ make -j4
➜ make install
➜ export LD_LIBRARY_PATH=/usr/local/glibc-2.14/lib:$LD_LIBRARY_PATH

➜ [JosephZeng@LOCAL-202-103 build]$ /usr/local/php/bin/php -m | grep swoole
swoole

#完工

Author: josephzeng

Date: <2016-12-13 Tue>

Generated by Emacs 24.5.1 (Org mode 8.2.10)

Last Updated <2016-12-13 Tue>

Validate