thathoo
12-02-2006, 10:58 PM
Hi.
I have my home directory on my departments server. Somehow I am not
able to write to a file using a php code,
$myFile = "trial3.txt";
$fh = fopen($myFile, "a+") or die("can't open file");
fwrite($fh, "teststring\n");
fclose($fh);
Instead of a+ if i use r or w or anything, it does not work. Could this
be a permission thing? The entire directory had a 777 permission and
even i after i created a file and chmod'ed 777 to it, the code couldnt
open it. What could be the matter? It doesnt go away if i change it to
'w' or 'w+' or 'r' or 'r+'.
When i use the shell to parse the php script, it does actually write it to the file. But not when i open the url in the browser. What could be the matter?
Rahul
I have my home directory on my departments server. Somehow I am not
able to write to a file using a php code,
$myFile = "trial3.txt";
$fh = fopen($myFile, "a+") or die("can't open file");
fwrite($fh, "teststring\n");
fclose($fh);
Instead of a+ if i use r or w or anything, it does not work. Could this
be a permission thing? The entire directory had a 777 permission and
even i after i created a file and chmod'ed 777 to it, the code couldnt
open it. What could be the matter? It doesnt go away if i change it to
'w' or 'w+' or 'r' or 'r+'.
When i use the shell to parse the php script, it does actually write it to the file. But not when i open the url in the browser. What could be the matter?
Rahul