>I've been trying and trying to get my site to work lately and all but one
>part does. Of course that one part is the most important part (it always
>My problem is probably rather simple to most of you, but I don't know how to
>get around it: My script does not have permissions to write/append files or
>just flat out create the files; it can read any files (accessed
>"files//nameoffile.xml"). Originally I was working with text files, but
>that didn't work either (and had the exact same problems).
>So my question is this: how do I get my script to have permissions to write
>or append to any file?
Your question should be more like:
How do I get specific files to be readable/writeable by PHP?
The only way to get any arbitrary file readable/writeable by PHP is to run
PHP (ie, Apache) as 'root' and that's just plain stupid.
Under Un*x, you can do:
chmod 766 filename
and then PHP will be able to read/write it.
NOTE: So will *ANY* other user on the same system using
You do *NOT* *NOT* *NOT* *NOT* want world-write-able files in your web-tree.
Put them in your home directory, *NEXT* to 'htdocs' or 'www' or 'web' or
whatever they called the directory where you stick your HTML files.
Use a full pathname to access the file.
If you don't know the pathname, you can do:
to figure it out.
If you can't SSH (or telnet) [is any ISP dumb enough to still allow telnet?]
in to your server, then you *might* be able to use your FTP client to alter
a file's permissions.
If you are on Windows, the same principles apply, but the permissions system
changed from version to version, and in some cases, you're just screwed
because there are no sensible alternatives to set the permissions of a file.
Like Music? http://l-i-e.com/artists.htm
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php