I'm running a relatively old version (4.4.0) of PHP which has been compiled with --enable-sigchld. The return code from the tar command packing up the backup is obtained through pclose(); in my case, I always get a -1, causing the backup to fail. However, the (compressed) temporary tar-file is fine.

I have found several bug reports on php.net indicating that the return values as given by pclose(), exec(), passthrough() and system() can be wrong (-1 instead of the correct one, whatever that might be) if PHP's own SIGCHLD handler is used, i.e. if --enable-sigchld has been used. For example, a recent discussion (regarding exec()) can be found at http://www.php.net/manual/en/function.exec.php#76687. Or seach for all pclose() related bugs...

For now, I have simply bypassed the check of the return code if it equals -1; but is there a better, more generic way to work around this particular PHP bug?

Many thanks,

Christian.