Home » » proc_close

proc_close

Written By 1 on Tuesday, October 2, 2012 | 8:58 AM

int proc_close ( resource $process )

Close a process opened by proc_open()

proc_close() is similar to pclose() except that it only works on processes opened by proc_open(). proc_close() waits for the process to terminate, and returns its exit code. If you have open pipes to that process, you should fclose() them prior to calling


It seems that if you configured --enable-sigchild when you compiled PHP (which from my reading is required for you to use Oracle stuff), then return codes from proc_close() cannot be trusted.



Using proc_open's Example 1998's code on versions I have of PHP4 (4.4.7) and PHP5 (5.2.4), the return code is always "-1".  This is also the only return code I can cause by running other shell commands whether they succeed or fail.



I don't see this caveat mentioned anywhere except on this old bug report -- http://bugs.php.net/bug.php?id=29123


0 Comment:

Post a Comment