AGI script can't write to file

I’m having problems with an AGI that I’m experimenting with. The script is called but I think it can’t open a file for opening.

Here’s the code:

<?php $fp=fopen('php://stdin', 'r'); $out=fopen('temp.txt', 'a'); for($i=0;$i<9;$i++) { fwrite($out,fgets($fp)); } ?>

Sorry, but I have to ask this. Do you have permissions to write in the location you are trying to create a file? Your AGI script will be executed by the same user as the Asterisk process. Can that user write to that directory? Can you run the script from the command line with success?

Possibly try writing the file some place like /tmp where anyone can write the file.


I was gonna say…sounds like file permissions are not quite lined up.

The process is owned by root but I’ll try it anyway.