I use one script to create a folder on the server using PHP, like so:
mkdir("folder/test/", 0777);
Then I use another script to create a file and put some contents into it, like so:
fwrite( fopen('folder/test/filename', 'w'), 'Test text' );
This, however results in:
Warning: fopen() [function.fopen]: SAFE MODE Restriction in effect. The script whose uid is XXXXX is not allowed to access ...
If, however, I try to create the file in the parent directory, like so:
fwrite( fopen('folder/filename', 'w'), 'Test text' );
it works fine. The parent folder ('folder' in the above example) is set to 777 'manually', so the 'SAFE MODE Restriction' only appears when I first create a folder using mkdir
and then try to write in the same folder. How can this be?