Giter Site home page Giter Site logo

Comments (5)

andot avatar andot commented on May 2, 2024

一样的,你同样做这样的设置就可以了。

from hprose-php.

forgottener avatar forgottener commented on May 2, 2024

在hprose/hprose-php里全文搜索了'daemon',没有这个设置项吧?

from hprose-php.

andot avatar andot commented on May 2, 2024

是 swoole 的设置,使用 hprose-swoole 就可以了。

from hprose-php.

forgottener avatar forgottener commented on May 2, 2024

解决了,参考http://rango.swoole.com/archives/59 加个daemonize的方法

function daemonize()
{
        $pid = pcntl_fork();
        if ($pid == -1) {
            die("fork(1) failed!\n");
        } elseif ($pid > 0) {
            //让由用户启动的进程退出
            exit(0);
        }
        //建立一个有别于终端的新session以脱离终端
        posix_setsid();
        $pid = pcntl_fork();
        if ($pid == -1) {
            die("fork(2) failed!\n");
        } elseif ($pid > 0) {
            //父进程退出, 剩下子进程成为最终的独立进程
            exit(0);
        }
}
daemonize();
$server = new Server("tcp://0.0.0.0:1314");
$server->addFunction("hello");
$server->start();

from hprose-php.

andot avatar andot commented on May 2, 2024

原来你用的是 Hprose\Socket\Server 啊,这个 server 是为了方便在 windows 下调试用的,所以没用 pcntl 这个扩展。

from hprose-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.