ubuntu编译安装swoole
安装openssh-server
sudo apt-get install openssh-server -y修改su密码
# 回车输入两次密码即可,忽略系统提示的任何文字,系统只提示密码过简,不会拦截修改。
sudo password root安装php7.3
sudo apt-get update && apt-get upgrade
sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update -y
sudo apt-get install -y php7.3安装php7.3-dev
编译swoole需要phpize,所以安装php开发版,得到编译工具。如果是运行swoole,只安装它即可。
sudo apt-get install php7.3-dev -y安装php-mbstring
默认php是不带mbstring的,但think-swoole依赖mbstring扩展
sudo apt-get install php7.3-mbstring -y安装编译环境
sudo apt-get install gcc-4.8 make autoconf -y编译swoole源码
# 进入swoole源码目录
cd swoole
phpize && ./configure && make && sudo make install配置php扩展
extension=swoole.so查看是否加载扩展
php -m编译问题
configure: error: Cannot find php-config. Please use --with-php-config=PATH编译前运行
./configure --with-php-config=/path/xxx查找
php-config路径:find -name php-configCannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this scriptapt-get install autoconf -ygcc-c++
apt-get install build-essential
ubuntu编译安装swoole
http://blog.icy8.cn/posts/55819/