I have a folder with 3 different php scripts in it. email.php txt.php android.php
I pipe emails and/or txts to their respective scripts, and use http POST to send da
Use ls as @DavidXia suggests and check who has ownership of the output files. They should be owned by the user who was running whichever script created them. If the files are owned by different users, then you will need to put the users in a common group and assign all the files to be owned by that group (the users who own the files can remain discrete). Then you'll also want to assign g+rw to all those files via chmod.
Ok, so with the help of everyone who responded, I have worked out a solution: The email and txt scripts are run by user 'owner' and the htmlPOST is run by user '?'
I had to make the folder chmod 777 in order for user '?' to work
When each script runs, it checks for the file 'output.php'. If it didn't exist, then after the fclose I added a chmod 777 - that way the scripts run by other users could open/write it later. If the file already existed, then I didn't add the chmod because if it was the wrong user it created an error. So a simple example of it:
$data = '//data fields condensed into a single string obtained from email or txt';
$filename= "output.php";
if (file_exists($filename)){
$newFile= fopen($filename, 'w+');
fwrite($newFile, $data);
fclose($newFile);
} else {
$newFile= fopen($filename, 'w+');
fwrite($newFile, $data);
fclose($newFile);
chmod($filename, 0777);
}
Thanks for your help!
if it is a permission problem and you are
unable to manually change the permissions to 777
maybe you could try:
$filename= "output.php";
// programatically set permissions
if(!file_exists($filename)){
touch($filename);
chmod($filename, 0777);
}
$data = '//data fields condensed into a single string obtained from email or txt';
$newFile= fopen($filename, 'w+');
fwrite($newFile, $data);
fclose($newFile);