Msg#: 3567033 posted 7:52 pm on Feb 5, 2008 (gmt 0)
Hi, I've been having problems writing to a text file on my server. I am using php to write the file. I have created a directory above my document root and I want to store a cache file in there. The problem I am having is that the file is still being writen to the document root even though I have defined the absolute path to where the file is supposed to go. I have no idea why this would happen. The php script can find the file but can't open it or read it. The permissions on the file are 775.
open_basedir string Limit the files that can be opened by PHP to the specified directory-tree, including the file itself. This directive is NOT affected by whether Safe Mode is turned On or Off.
When a script tries to open a file with, for example, fopen() or gzopen(), the location of the file is checked. When the file is outside the specified directory-tree, PHP will refuse to open it. All symbolic links are resolved, so it's not possible to avoid this restriction with a symlink. If the file doesn't exist then the symlink couldn't be resolved and the filename is compared to (a resolved) open_basedir
You should be able to add the path for the script to the list of allowed values.