PHP安装Swoole支持DTLS协议步骤

2022-09-03 16:33:24 66 0
魁首哥

目录

  • 升级GCC
    • 安装新版Openssl
    • 安装新版php 7.3.16
    • 安装S编程woole 4.5.0

升级GCC

  • 安装Centos-release-scl
sudo yum install centos-release-scl
  • 安装devtoolset
sudo yum install devtoolset-8-gcc*
  • 激活对应的devtoolset
scl enable devtoolset-8 bash
  • 查看版本
gcc -v

PHP安装Swoole支持DTLS协议步骤

安装新版Openssl

  • 下载新版Openssl
wget https://oss.qiaqa.com/article/2022/09/03/1334.zip
unzip OpenSSL_1_1_1-stable.zip
  • 进入目录,指定安装路径,编译
./configure --prefix=/usr/local/openssl // 指定安装路径
make && make install
  • 替换当前系统的旧版本 openssl 「先保存原来的」
mv /usr/bin/openssl /usr/bin/openssl.old
mv /usr/lib64/openssl /usr/lib64/openssl.old
mv /usr/lib64/libssl.so /usr/lib64/libssl.so.old
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/openssl/incpythonlude/openssl /usr/include/openssl
ln -s /usr/local/openssl/lib/libssl.so /usr/lib64/libssl.so
echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
ldconfig -v 
  • 查看版本
openssl version

安装新版PHP 7.3.16

  • 下载php7.3.16, 解压缩wget

点击下载

  • 进入目录,指定安装目录编译

./configure --prefix=/usr/local/php7 --with-openssl-dir=/usr/local/openssl/ --with-openssl --enable-fpm --disable-fileinfo --with-config-file-path=/usr/local/php7/etc --with-config-file-scan-dir=/usr/local/php7/etc/php.d

  • Make && Make Install
make && make install
  • 配置

php-fpmcd /usr/local/php7/etc/ mv php-fpm.conf.default php-fpm.conf cd php-fpm.d mv www.conf.default www.conf

配置php.ini

cd ~/php-7.3.16  #进入php包目录
cp php.ini-production  /usr/local/php7/etc/php.ini
  • 开启php-fpm
/usr/local/php7/sbin/php-fpm

安装Swoole 4.5.0

  • 下载新版Swoole
git clone https://github.com/swoole/swoole-src.git
  • 进入目录编译

/usr/lo恰卡编程网cal/php7/bin恰卡编程网/phpize && ./configure --with-openssl-dir=/usr/local/openssl/ --with-phttp://www.cppcns.comhp-config=/usr/local/php7/bin/php-config && make && sudo make install

  • 添加extension=swoole.so到php.ini
vi /usr/local/php7/etc/php.ini
extension=swoole.so
  • 查看安装的swoole情况
/usr/local/php7/bin/php --ri swoole
[root@localhost swoole-src]# /usr/local/php7/bin/php --ri swoole
swoole
Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 4.5.0-alpha
Built => Apr  2 2020 01:37:54
coroutine => enabled
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
openssl => OpenSSL 1.1.1d  10 Sep 2019
pcre => enabled
zlib => 1.2.7
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
async_Redis => enabled
Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.Unixsock_buffer_size => 8388608 => 8388608

以上就是PHP安装Swoole支持DTLS协议步骤的详细内容,更多关于PHP安装Swoole支持DTLS的资料请关注我们其它相关文章!

收藏
分享
海报
0 条评论
66
上一篇:详解PHP合并多个PDF文件的方法 下一篇:详解PHP渗透测试文件包含漏洞与利用

本站已关闭游客评论,请登录或者注册后再评论吧~

忘记密码?

图形验证码