centos7安装 swoole详细教程

swoole的优点就不说了,安装对于没接触过的还是优点麻烦,写个教程看看能不能帮上需要的同学们!

centos7的安装就不说了 网上很多,一般都是虚拟机里面安装的 ,我是在mac虚拟机里面装的 (我装的时候分区就没有按照教程分区,系统自动分区的(20G)因为按照教程分区 有错误安装不了)温馨提示里面有桌面的程序看自己需不需要 ,自己选择!

 

安装好centos7后 咱们就开始装swoole,二话不说先下载php ,毕竟swoole是运行在php上面的插件,php是必须的,PHP当然是7以上,php.net官网下载又慢,所以现下载它!

可以命令可以桌面访问下:

$ cd /usr/local/src/
$ wget http://cn2.php.net/distributions/php-7.4.1.tar.bz2
$ tar jxvf php-7.4.1.tar.bz2

cd是打开目录  这个就不用说了 (tab键都 不知道是怎么用的绝对小白)  上面的命令如果没有权限记得在前面加上     『sudo 命令』空格别忘记了,这个是已管理员权限运行后面命令 肯定回输入你的密码

wget是一个下载文件的工具 

tar 是解压我们下载的文件包

然后进入到目录  编译源码

$ cd php-7.4.1/
$ ./configure --prefix=/usr/local/php7

温馨提示

prefix=后面示放的目录 可以自己修改
/usr/local/php7这个目录没有的需要创建  命令示例:sudo mkdir /usr/local/php7
再次声明 如果没有权限就 在这个命令前面加sudo 或者su

 

 

 

没有看到Thank you for using PHP.的同学,

QQ496631085

请看你的报错是什么示例:

 

 

这里示报错sqlite3

 

咱们就页面找一下报错对应的安装包的代码:

解决 error: the HTTP XSLT module requires the libxml2/libxslt 错误

解决 error: the HTTP image filter module requires the GD library. 错误

解决 error: the GeoIP module requires the GeoIP library. 错误

解决 error: the Google perftools module requires the Google perftools 错误

解决 error: libatomic_ops library was not found. 错误

解决 error trying to exec 'cc1plus': execvp: No such file or directory 错误

解决 error: [pool www] cannot get uid for user 'www-data' 错误

解决configure: error: mbed TLS libraries not found. 错误。

需要安装mbedtls,教程:https://www.24kplus.com/linux/281.html

解决 error: Cannot find OpenSSL's <evp.h> 错误

解决 error: Libtool library used but 'LIBTOOL' is undefined 错误

解决 exec: g++: not found 错误

解决 configure: error: tss lib not found: libtspi.so 错误

解决 Can't exec "autopoint": No such file or directory 错误

解决 configure: error: libcrypto not found. 错误

解决 configure: error: Package requirements (libffi >= 3.0.0) were not met: No package 'libffi'found 错误

解决 fatal error: uuid.h: No such file or directory 错误

解决 configure: error: openssl lib not found: libcrypto.so 错误

解决 tar (child): lbzip2: Cannot exec: No such file or directory 错误

解决 configure: error: C++ preprocessor "/lib/cpp" fails sanity check 错误

解决 configure: error: Please reinstall the BZip2 distribution 错误

解决 configure: error: cURL version 7.15.5 or later is required to compile php with cURL support 错误

解决 configure: error: not found. Please provide a path to MagickWand-config or Wand-config program 错误 

解决 configure: error: no acceptable C compiler found in $PATH 错误

解决 configure: error: Package requirements (icu-uc >= 50.1 icu-io icu-i18n) were not met: 错误

解决 configure: error: Package requirements (sqlite3 > 3.7.4) were not met: No package 'sqlite3'found 错误

解决 configure: error: Package requirements (oniguruma) were not met: No package 'oniguruma' found错误

 

https://www.24kplus.com/linux/400.html这是里面对应的代码

QQ496631085

PHP配置成功了,下一步,进行构建安装。使用命令:温馨提示这个步骤大约时间要长一点
$ make && make install

如果报错 -bash:make:command not found,是因为安装系统的时候使用的是最小化 mini 安装,系统没有安装 make、vim 等常用命令,直接 yum 安装下即可

$ yum -y install make

 

 

 

 

 

 

 

如图就是安装完成了

 

 

 

 

 

 

 

此时已经安装好了咱们在配置一下

 

posted @ 2020-01-05 15:12  xiaohe520  阅读(1745)  评论(1编辑  收藏  举报