Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@swoole/library/ext/sockets.php(217) E_DEPRECATED:Creation of dynamic property Swoole\Coroutine\Socket::$__ext_sockets_nonblock is deprecated #5333

Closed
hetao29 opened this issue May 22, 2024 · 3 comments

Comments

@hetao29
Copy link

hetao29 commented May 22, 2024

Please answer these questions before submitting your issue.

  1. What did you do? If possible, provide a simple script for reproducing the error.
socket_set_block("Swoole\\Coroutine\\Socket::")^M
  1. What did you expect to see?
19  ()  swoole_socket_set_block("Swoole\\Coroutine\\Socket::")^M
20  @swoole/library/ext/sockets.php(217)    E_DEPRECATED:Creation of dynamic property Swoole\Coroutine\Socket::$__ext_sockets_nonblock is deprecated
  1. What did you see instead?

  2. What version of Swoole are you using (show your php --ri swoole)?

swoole 5.1.2
php 8.3.7

  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?
PHP 8.3.7 (cli) (built: May 10 2024 15:35:58) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.7, Copyright (c), by Zend Technologies

Linux test 5.15.0-105-generic #115-Ubuntu SMP Mon Apr 15 09:52:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
@NathanFreeman
Copy link
Member

编译过程中加入--enable-sockets试试看

@hetao29
Copy link
Author

hetao29 commented May 22, 2024

编译过程中加入--enable-sockets试试看

加上就好了,感谢~,不过看官方说明如下:

依赖 sockets 扩展,v4.3.2 版本后该参数的作用被削弱了,因为 Swoole 内置的 [Coroutine\Socket](https://wiki.swoole.com/#/coroutine_client/socket) 可以完成大部分事情

@NathanFreeman
Copy link
Member

协程socket设计就是非阻塞的,使用socket_set_block的话需要引入php的socket扩展

@matyhtf matyhtf closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants