You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
What version of Swoole are you using (show your php --ri swoole)?
php --ri swoole:
swoole
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
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
The text was updated successfully, but these errors were encountered:
Please answer these questions before submitting your issue. Thanks!
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";
});
上面这段代码放到容器外执行,则没有问题。
What did you expect to see?
ok
terminate: 0
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
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
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
The text was updated successfully, but these errors were encountered: