php实例

关注公众号 jb51net

关闭
首页 > 网络编程 > PHP编程 > php实例 > PHP安装Swoole支持DTLS

PHP安装Swoole支持DTLS协议步骤

作者:KunkkaWu

这篇文章主要为大家介绍了PHP安装Swoole支持DTLS协议步骤示例,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪

升级GCC

sudo yum install centos-release-scl
sudo yum install devtoolset-8-gcc*
scl enable devtoolset-8 bash
gcc -v

安装新版Openssl

wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1-stable.zip
unzip OpenSSL_1_1_1-stable.zip
./configure --prefix=/usr/local/openssl // 指定安装路径
make && make install
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/include/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

点击下载

./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

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
/usr/local/php7/sbin/php-fpm

安装Swoole 4.5.0

git clone https://github.com/swoole/swoole-src.git

 /usr/local/php7/bin/phpize && ./configure --with-openssl-dir=/usr/local/openssl/ --with-php-config=/usr/local/php7/bin/php-config && make && sudo make install

vi /usr/local/php7/etc/php.ini
extension=swoole.so
/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的资料请关注脚本之家其它相关文章!

您可能感兴趣的文章:
阅读全文