1
看来,在我的服务器上popen()
根本不起作用。我通过浏览器访问test.php
,文件postt1.php
和postt2.php
未被执行。没有写入article1.txt
和article2.txt
文件。所有文件都在同一个目录中。Popen不工作
可能是什么问题?
在文件test.php
我:
<?php
$pipe1 = popen('postt1.php', 'w');
$pipe2 = popen('postt2.php', 'w');
pclose($pipe1);
pclose($pipe2);
echo "end";
?>
内的文件postt1.php
我:
<?php
$tosave = "Hello there";
$file = fopen("article1.txt","w");
fwrite($file,$tosave);
fclose($file);
echo $tosave;
echo "<br>done";
?>
,并在postt2.php
我有,只是我写入文件article2.txt
同样的事情。
POPEN需要一个命令第一个参数,你只是过客'postt1.php',我会说像' php postt1.php“。如果你想执行那些(postt1&postt2)文件,则使用'include'。 – Jigar
你确定 - 在这个页面上popen没有另一个参数 - http://stackoverflow.com/questions/70855/how-can-one-use-multi-threading-in-php-applications – Brana