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 proc_open doesn’t comply with php7.4 new features #4107

Closed
duan-feng opened this issue Mar 18, 2021 · 1 comment
Closed

swoole proc_open doesn’t comply with php7.4 new features #4107

duan-feng opened this issue Mar 18, 2021 · 1 comment
Labels

Comments

@duan-feng
Copy link

duan-feng commented Mar 18, 2021

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a simple script for reproducing the error.

php7.4 proc_open 支持传入数组作为命令,支持null和重定向描述符。但swoole钩子版本proc_open都不支持。
示例代码如下
<?php
use function Swoole\Coroutine\run;
run(function () {
$res = proc_open(['echo', 'ok'], [['null'], ['pipe', 'w'], ['redirect', 1]], $pipes);
echo stream_get_contents($pipes[1]);
fclose($pipes[1]);
echo 'terminate: ' . proc_close($res) . "\n";
});

上面这段代码放到容器外执行,则没有问题。

  1. What did you expect to see?
    ok
    terminate: 0

  2. What did you see instead?
    PHP Fatal error: Uncaught TypeError: proc_open() expects parameter 1 to be string, array given in test.php:42
    Stack trace:
    #0 test.php(42): proc_open(Array, Array, NULL)
    编译出错 #1 {main}
    thrown in test.php on line 42

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

Swoole => enabled
Author => Swoole Team team@swoole.com
Version => 4.6.4
Built => Mar 15 2021 22:08:02
coroutine => enabled with boost asm context
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
sockets => enabled
http2 => enabled
pcre => enabled
zlib => 1.2.11
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

  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?

php -v:
PHP 7.4.16 (cli) (built: Mar 15 2021 22:09:21) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.16, Copyright (c), by Zend Technologies

@matyhtf matyhtf added feature request Incompatibility in progress Maintainers are working on this labels Mar 23, 2021
@doubaokun doubaokun changed the title swoole版proc_open不支持php7.4新特性 swoole proc_open doesn’t comply with php7.4 new features Mar 26, 2021
@doubaokun
Copy link
Contributor

Fixed in #4121 please upgrade to v4.6.5 later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants