I have a php script that asynchronously accepts SOAP posts and forwards the reformatted info to another webservice. The posts are originally submitted to myPhpServer.php, which is:
include('util.php');
$InvoiceNumber = (string)simplexml_load_string(file_get_contents("php://input"))->Order->InvoiceNumber;
exec("wget -bqo /dev/null --post-data 'InvoiceNumber=$InvoiceNumber' http://mysite.com/auto/myPhp.php");
This is accepted by myPhp.php, which does not have any file-writing operations except at the very end when I add to my log file:
file_put_contents
(
'log.txt',
date('Y-M-j H:i:s T')."\t$InvoiceNumber\t".postToWebService($Order)."\n",
FILE_APPEND
);
This process spawns a new file in this directory called myPhp.php.[#] where # starts at 1 and increments per use of the script. So after some time, this builds up to a bunch of unreadable 0kb files like myPhp.php.1, myPhp.php.2, myPhp.php.3 and so on. I assume that the culprit is something above, as the rest of it does not read/write external data. Any clue what would cause this behavior generally, at least?
You do this:
This does a wget that writes the LOG (error) messages to /dev/null, but it retrieves the file calles myPhp.php, and it makes a file for that.
read the man-page of wget, but I think you can use
-Oto specify the output-document, just like you are using-o.