Hi all. I am working on a PHP script that is supposed to create a new file and write content to it. I set up the directory, set the privileges, and then ran the script. Things worked fine when the file existed, but when the script had to write to a file that didn’t exist - and should have created a new one - I got three error messages:
“Warning: open_basedir restriction in effect. File is in wrong directory [directory path of the php file]”
“Warning: fopen(” [path to file I was trying to create", “w”) - Operation not permitted in [ directory path of the php file] on line 12"
“Warning: fwrite(): supplied argument is not a valid File-Handle resource in [ directory path of the php file]”.
The knowledge base docs said that Dreamhost’s security measures prevent scripts from writing to files outside the home directory, but my script was writing to a file a few directories into the home directory.
Is it possible to do this kind of operation on Dreamhost, or is there another way I can use?
Thanks!
- Chris