Home>Article>Operation and Maintenance> How to install swoole extension in kanglephp under centos

How to install swoole extension in kanglephp under centos

藏色散人
藏色散人 forward
2021-03-30 18:15:14 2502browse

The following tutorial column fromcentoswill introduce to you how to install the swoole extension in kanglephp under centos. I hope it will be helpful to friends in need!

How to install the swoole extension in kanglephp under centos

First, test the environment centos6 64-bit and centos7, easypanel2.6.26, kangle3.5.14 php7.3.0

If it is centos7, please ignore the gcc installation. First upgrade the gcc library to 4.8.

curl -Lks http://yum.osyum.com/linux/gcc/hop5.repo > /etc/yum.repos.d/hop5.repoyum install gcc gcc-g++ -y

You can ignore the next installation of nghttp

wget http://yum.osyum.com/linux/nghttp/nghttp2-1.35.0.tar.gztar -zxvf nghttp2-1.35.0.tar.gzcd nghttp2-1.35.0./configuremakemake install

Next we download the swoole extension, https:/ /github.com/swoole/swoole-src, we use php7.3 to install the swoole extension. The installation of other versions is the same. Note that the PHP directory must be correct.

wget --no-check-certificate https://codeload.github.com/swoole/swoole-src/zip/master -O swoole-src-master.zipunzip swoole-src-master.zipcd swoole-src-master/vhs/kangle/ext/php73/bin/phpize./configure --with-php-config=/vhs/kangle/ext/php73/bin/php-configmakemake install

![[centos]kanglephp under centos install swoole extension](https://waterbear.pw/ueditor/... "[centos]kanglephp under centos install swoole extension")

The appearance of this proves that half of the success is achieved, then let php support swoole, and then we will make the extension of php73 to support swoole

mv /root/php-7.3.0/php.ini-development /vhs/kangle/ext/php73/etc/php.d/php.ini

Edit vi /vhs/kangle/ext/php73/etc/php.d/php. ini
Add

extension = "/vhs/kangle/ext/php73/lib/php/extensions/no-debug-non-zts-20180731/swoole.so"

at the end to save and exit. If you compile other modules, you can also add
to check whether the swoole module is supported

/vhs/kangle/ext/php73/bin/php -m

The presence of swoole in the list proves complete success

![[centos]Install the swoole extension with kanglephp under centos](https://waterbear.pw/ueditor/... "[centos]Install the swoole extension with kanglephp under centos ")

Note that after restarting, kangle's php7.3 may use /vhs/kangle/ext/php73/etc/php.d/php.ini as the new php.ini, so you still need to Make security processing in php.ini

Add after disable_functions=

eval,passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,disk_total_space,disk_free_space,error_log,putenv,popen,ini_set,chmod,assert,pcntl_exec,phpfunc;

Save and exit.

The above is the detailed content of How to install swoole extension in kanglephp under centos. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete