Search code examples
phplinuxphp-extensionpcntl

Why appear "Linux host path" in the process of the code "echo"? Usage PHP extension "PCNTL"


I use PHP extension "PCNTL" write some codes, and run it in terminal, but why appear the Linux host Path "gdy@localhost:~/myDev/webroot/spider/my$"

This is my echo in terminal

This is my PHP CODE


Solution

  • why appear the Linux host Path "gdy@localhost:~/myDev/webroot/spider/my$"

    This is simply the prompt of your shell, which naturally appears because the parent process in your PHP CODE has run to its end. And this is because you used pcntl_waitpid's WNOHANG option.