Quote:
|
Originally Posted by tsb
Hi,
Sorry to keep posting, but when i use:
I get the error:
When i use the phpinfo() command it states that it is a Linux server.
The folder file.php resides in is chmoded to 777.
Can someone tell me what i've done wrong please?
Thanks alot.
|
The problem is that your script does not have permission in the directory where file.php resides to change permissions on a file. There are several ways to solve this each has it's own problems associated with it.
1) You can set the permissions on the directory high enough so that php can perform the chmod operation. Most likely this will have to be 777. The problem with this is that anyone will now have access at this level to the directory.
2) You can change ownership of the directory where file.php resides to the user under which your php script executes. This is usually the user "nobody". The problem with this is that unless you own the server sometimes you are not allowed to change the ownership of anything.
3) I have used a hybrid aproach of the first two with good results. You create the directory via a php script. This makes the owner the same as the user under which the script executes. Now you can chmod anything you like including the directory and any files it contains. A word of caution when doing this: If you have to chmod the directory itself to 777, which you most likely will in order to perform the chmod operation on the file, you should chmod it back to something less open like 666 when you are done so that "nobody" can not do whatver they like.
hope this helps,
gforce