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
<?phprequire__DIR__ . '/vendor/autoload.php';
$stdoutLogFile = 'test.log';
/*This works fine - it's writing to my log file*/$loop = new \React\EventLoop\StreamSelectLoop();
/*Nothing gets written to the log fileAlso, when starting this up, I get a notice & warning:PHP Notice: Event::add(): Epoll ADD(1) on fd 9 failed. Old events were 0; read change was 1 (add); write change was 0 (none): Operation not permitted in vendor/react/event-loop/ExtEventLoop.php on line 258PHP Warning: Event::add(): Failed adding event in vendor/react/event-loop/ExtEventLoop.php on line 258My Actual script doesn't have this warning, as it pipes from a Process stdout to the Stream. It still has the same problem though (not writing to the file)*/$loop = new \React\EventLoop\ExtEventLoop();
$stdout = newReact\Stream\Stream(fopen($stdoutLogFile, 'a'), $loop);
$stdout->on(
'error',
function ($error) {
var_dump($error);
}
);
$loop->addPeriodicTimer(
1,
function (React\EventLoop\Timer\TimerInterface$timer) use ($stdout) {
$stdout->write('Starting...');
}
);
$loop->run();
I tried the simplier demo code provided in README.md, and that didn't write either (same warnings generated).
Works fine when using 'StreamSelectLoop'.
Test System details:
CentOS 6.x
PHP 5.6.15 (Remi RPMs)
event phpinfo output
Event support => enabled
Sockets support => enabled
Debug support => disabled
Extra functionality support including HTTP, DNS, and RPC => enabled
OpenSSL support => enabled
Thread safety support => disabled
Extension version => 1.11.1
libevent2 headers version => 2.0.21-stable
Also tried it on a Vagrant box (scotch/box) by doing pecl install event
I'm trying to pipe output from a Process to my file (using Stream), and it doesn't write to the file. It gives me the same warnings as the example above.
Activity
clue commentedon Nov 26, 2015
Thanks for the report @giggsey, looks like this is the same problem as in #31?
I suppose it makes sense to provide a better example, several people already ran into this..
giggsey commentedon Nov 26, 2015
Okay, here's a simple version of my real problem
I'm trying to pipe output from a Process to my file (using Stream), and it doesn't write to the file. It gives me the same warnings as the example above.