0

I do have a PHP script which has a continuous ouptput (written to tmp file for logging). So far, I started the script right from the shell, but now, I would like to start it via shell_exec:

shell_exec("file.php >> /path/to/log 2>&1 &");

But shell_exec always return null instead of the PID. How can I get the PHP process ID and keep the output written to the file?

Thanks in advance.

1 Answer 1

1

Look into proc_open and proc_get_status instead.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.