編譯安裝swoole

2021-09-05 12:25:21 字數 2455 閱讀 3546

1、編譯安裝swoole

[root@localhost software]# git clone 

[root@localhost software]# cd swoole/

[root@localhost swoole]# ls ##檢視檔案沒有configure如果沒有執行下面**

[root@localhost swoole]# find / -name phpize

/root/software/php-7.0.33/scripts/phpize

/usr/local/php/bin/phpize

[root@localhost swoole]# /usr/local/php/bin/phpize ##執行phpize 檔案中將會出現configure

configuring for:

php api version: 20151012

zend module api no: 20151012

zend extension api no: 320151012

[root@localhost swoole]# ls ##檢視檔案是否有configure

[root@localhost swoole]# ./configure --with-php-config=/usr/local/php/bin/php-config

[root@localhost swoole]# make && make install ##安裝

2、編譯安裝完成後檢視是否安轉上了swoole.so

3、配置swoole擴充套件

[root@localhost swoole]# find / -name php.ini

/usr/local/php/lib/php.ini

[root@localhost swoole]# vim usr/local/php/lib/php.ini //在php.ini新增extension=swoole.so

[root@localhost swoole]# service nginx restart

redirecting to /bin/systemctl restart nginx.service

配置swoole出現的問題:

[root@localhost swoole]# php -m

bash: php: 未找到命令...

[root@localhost swoole]# export path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

[root@localhost swoole]# echo $path

/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

[root@localhost swoole]# php -m

bash: php: 未找到命令...

[root@localhost swoole]# ln -s /usr/local/php/bin/php /usr/bin/php

[root@localhost swoole]# php -m #檢視是否有swoole

[php modules]

bcmath

bz2core

ctype

date

domfileinfo

filter

gdhash

iconv

json

libxml

mbstring

mcrypt

mysqli

mysqlnd

openssl

pcre

pdopdo_mysql

pdo_sqlite

phar

posix

reflection

session

******xml

sockets

splsqlite3

standard

swoole

tokenizer

xmlxmlreader

xmlwriter

zlib

[zend modules]

[root@localhost swoole]# service php-fpm restart

gracefully shutting down php-fpm . done

starting php-fpm done

4、檢視phpinfo,這時候swoole拓展已經裝上

swoole 編譯安裝 最新swoole

適用於php5.3以上版本 centos7中 在此 選擇合適的版本,我用的是4.2.9 wget tar zxvf swoole 4.2.9.tgz cd swoole 4.2.9 phpize configure with php config usr local php bin php conf...

Swoole編譯安裝

編譯安裝 swoole擴充套件是按照php標準擴充套件構建的。使用phpize來生成php編譯配置,configure來做編譯配置檢測,make進行編譯,make install進行安裝。安裝swoole前必須保證系統已經安裝了下列軟體 php 5.3.10 或更高版本 gcc 4.4 或更高版本 ...

swoole 編譯安裝

swoole文件 環境 centos7 php.ini配置檔案路徑 usr local php etc php.ini 1 安裝swoole 1 tar zxvf swoole.tar.gz 2 cd swoole 目錄 3 usr local php bin phpize 執行phpize,路徑根...