How do I get something more meaningful than 'FALSE' when I can't open a file.
$myFile = "/home/user/testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
When I use the die
statement, can't open file
is returned to the client, and it is almost useless. If I remove it, no error is raised. If I return $fh
it is FALSE
. I tried both local file name and absolute file name. My index.html
file is in one of the sub folders of my hole folder. Furthermore, I am using suPHP with the folder I am trying to write to having a permission of 0755
(suPHP requires this for all folders).
How do I figure out why there was a problem, or at least query it before trying to open the file.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…