Question

This is more of a theoretical question.

When I run a PHP script that does a passthru to some other program, say a Java application, let's assume that program works for 30 minutes and then ends gracefully and PHP keeps calling it in a loop every single time...

... does the time PHP stays idle waiting for Java count as execution time or as idle time?

Was it helpful?

Solution

This manual page seems to indicate that on Windows the time will count as execution time, whereas on Linux it will not.

OTHER TIPS

As far as I know, PHP will wait (be idle) for the output until the maximum execution time is met. Then the process will terminate.

Edit: I was wrong. PHP will hang until the program closes with the passthru function, regardless of the execution time. I miss read the documentation. See notes on http://php.net/manual/en/function.passthru.php

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top