Skip to content

Call to undefined function Lib\swoole_async_writefile()  #3

@zhy654

Description

@zhy654

报错
ERROR php_swoole_server_rshutdown (ERRNO 503): Fatal error: Uncaught Error: Call to undefined function Lib\swoole_async_writefile() in /media/zhy/data/data/htdocs/git/Light-php/frame/Lib/Log.php:57

是因为
https://wiki.swoole.com/wiki/page/p-async.html
image

把log改一下
引入
use Swoole\Coroutine\System;

// swoole_async_writefile($dir_path.$filename , $msg, NULL, FILE_APPEND);
$filename = $dir_path.$filename;
$system = new System();
go(function () use ($filename,$msg, $system)
{
$r = $system->writeFile($filename,$msg, FILE_APPEND);
var_dump($r);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions