Unless this is a server issue, this should be working just fine; I examined it several times:
<?php
if (file_exists("x/y") == false) {
mkdir("x/y", 0777);
}
file_put_contents("x/y/z.txt", "Hello world!");
?>
This is just a test script of course. The folder is created just fine, no problems there. However, when I try to create a new file inside it, it doesn't work.
This problem doesn't happen if the folder is created in the file manager. If you need the error messages to help me:
Warning: file_put_contents() [function.file-put-contents]: SAFE MODE Restriction in effect. The script whose uid is 75463 is not allowed to access /www/uuuq.com/a/b/e/abentley/htdocs/x/y owned by uid 2001 in /www/uuuq.com/a/b/e/abentley/htdocs/x.php on line 5
Warning: file_put_contents(x/y/z.txt) [function.file-put-contents]: failed to open stream: No such file or directory in /www/uuuq.com/a/b/e/abentley/htdocs/x.php on line 5
Thanks in advance
EDIT***
Just an afterthought, should I not have used file_exists() to detect the existence of a directory?
