It seems that on my server the popen()
doesn't work at all. I access test.php
via browser and the files postt1.php
and postt2.php
do not get executed. The article1.txt
and article2.txt
files are not written. All the files are in the same directory.
What could be the problem?
In file test.php
I have:
<?php
$pipe1 = popen('postt1.php', 'w');
$pipe2 = popen('postt2.php', 'w');
pclose($pipe1);
pclose($pipe2);
echo "end";
?>
Inside files postt1.php
I have:
<?php
$tosave = "Hello there";
$file = fopen("article1.txt","w");
fwrite($file,$tosave);
fclose($file);
echo $tosave;
echo "<br>done";
?>
and in the postt2.php
I have the same thing except that I write to file article2.txt
.