workerman icon indicating copy to clipboard operation
workerman copied to clipboard

mac php7.3 run webserver exit with status 11

Open bamboo-cp3 opened this issue 7 years ago • 3 comments

image i tried tcp udp http, and everything's OK.

bamboo-cp3 avatar Aug 20 '19 08:08 bamboo-cp3

Try creating a file at ~/.config/psysh/config.php if not already there.

<?php
return [
  'usePcntl' => false,
];

And

In php.ini set pcre.jit=0

this works for me.

image

I have MacBook Pro 2018

Xsaven avatar Aug 20 '19 13:08 Xsaven

@Xsaven @bamboo-cp3 The following is my personal thought. first, through error output, we can roughly see the code in worker.php L1603. Let's analyze a wave of this code line.

// Suspends execution of the current process until a child has exited, or until a signal is delivered
            $status = 0;
            $pid    = pcntl_wait($status, WUNTRACED);
            // Calls signal handlers for pending signals again.
            pcntl_signal_dispatch();
            // If a child has already exited.
            if ($pid > 0) {
                // Find out witch worker process exited.
                foreach (static::$_pidMap as $worker_id => $worker_pid_array) {
                    if (isset($worker_pid_array[$pid])) {
                        $worker = static::$_workers[$worker_id];
                        // Exit status.
                        if ($status !== 0) {
                            static::log("worker[" . $worker->name . ":$pid] **exit with status $status**");
                        }

Let's focus on the analysis

  1. $status = 11
  2. pcntl_wait($status, WUNTRACED);

pcntl_wait() will store status information in the status parameter which can be evaluated using the following functions: pcntl_wifexited(), pcntl_wifstopped(), pcntl_wifsignaled(), pcntl_wexitstatus(), pcntl_wtermsig() and pcntl_wstopsig().


At last, we can roughly say that 11 should be the signal, and the rest is up to you. Good luck!

taozywu avatar Aug 21 '19 02:08 taozywu

Try creating a file at ~/.config/psysh/config.php if not already there.

<?php
return [
  'usePcntl' => false,
];

And

In php.ini set pcre.jit=0

this works for me.

image

I have MacBook Pro 2018

PHP version:7.3.5 MacBook Pro 2019 Thanks. This solution works for me

jaylin507 avatar Dec 11 '19 11:12 jaylin507