2012-07-30 61 views
2

我有一个php脚本,异步接受SOAP帖子并将重新格式化的信息转发到另一个web服务。该职位最初提交给myPhpServer.php,那就是:为什么我的php脚本产生[filename] .php。[#]文件?

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"); 

这是由myPhp.php,这没有任何文件的写入操作,除了在最后的时候我添加到我的日志文件受理:

file_put_contents 
(
    'log.txt', 
    date('Y-M-j H:i:s T')."\t$InvoiceNumber\t".postToWebService($Order)."\n", 
    FILE_APPEND 
); 

此进程生成这个目录叫myPhp.php在一个新的文件。[#],其中#从1开始,每次使用脚本的增量。因此,经过一段时间,这会形成一堆不可读的0kb文件,如myPhp.php.1,myPhp.php.2,myPhp.php.3等等。我假定罪魁祸首是上面的东西,因为其余部分不读取/写入外部数据。任何线索通常会导致这种行为,至少?

回答

4

你这样做:

exec("wget -bqo /dev/null --post-data 'InvoiceNumber=$InvoiceNumber' http://mysite.com/auto/myPhp.php"); 

这确实写入日志(错误)消息到/ dev/null,但它检索文件卡列斯myPhp.php,它使一个文件,一个的wget 。

阅读wget的手册页,但我认为您可以使用-O指定输出文档,就像您使用-o一样。

相关问题