lnmp 环境安装swoole扩展

 超哥  linux  2022-09-26  544  发表评论

1.

首先找到swoole扩展包的地址:

https://pecl.php.net/package/swoole


里面有swoole的各种版本,选择一个下载,例如我下载的是最新的4.0.3

执行命令:

wget -c https://pecl.php.net/get/swoole-4.0.3.tgz

之后,swoole扩展就下载下来了,

2.解压

tar -zvxf swoole-4.0.3.tgz

3. 目录切换到解压完成的包里面

cd swoole-4.0.3

4.通过 phpize 建立 php的外挂模块

/usr/local/php/bin/phpize

5.配置编译安装

./configure --with-php-config=/usr/local/php/bin/php-config

make && make install

6.将扩展extension=swoole.so添加到 /usr/local/php/etc/php.ini 中。

找到你的php.ini所在位置,

vim /usr/local/php/etc/php.ini

添加extension=swoole.so

7.重启

lnmp restart

或者

/etc/init.d/php-fpm restart

参考以下命令:

PHP-FPM状态管理:/etc/init.d/php-fpm {start|stop|quit|restart|reload|logrotate}

Nginx状态管理:/etc/init.d/nginx {start|stop|reload|restart}

MySQL状态管理:/etc/init.d/mysql {start|stop|restart|reload|force-reload|status}

Memcached状态管理:/etc/init.d/memcached {start|stop|restart}

PureFTPd状态管理: /etc/init.d/pureftpd {start|stop|restart|kill|status}

ProFTPd状态管理: /etc/init.d/proftpd {start|stop|restart|reload}

Redis状态管理: /etc/init.d/redis {start|stop|restart|kill}

所有评论
加载评论 ...
发表评论