I've run into an issue moving onto my test (and tried it on prod, no go) where I have a php script create a file and put some data in that file.
I've set the permissions to R, W, X for "Owner, Group, Other" using winSCP (i'm not much for commandline yet).
What i can see is that the script is able to create the file (i've deleted, and it recreates the files properly every time), but the exact same script can't write to the file and I get a permission error. "failed to open stream: permission denied"
Here's the script that I'm using,it worked in windows, but now on linux, no go.
Any ideas?
$type='get'; $count_my_page = ("list".$counterDate.".txt"); if(!file_exists($count_my_page)){ $fp=fopen($count_my_page, "w"); $putArray=array($type=>'1'); $putJson=json_encode($putArray); fputs($fp, $putJson); fclose($fp); } else { $hits = file($count_my_page); if(empty($hits)){ $putArray=array($type=>'1'); $putJson=json_encode($putArray); } else { $putArray=json_decode($hits[0], true); if(!array_key_exists($type, $putArray)){ $putArray[$type] = '1'; } else { $hit=$putArray[$type]; $putArray[$type]++; } } $putJson=json_encode($putArray); $fp=fopen($count_my_page, "w"); fputs($fp, $putJson); fclose($fp); }