Hi,
I have an RSS generation script which I use to open a file using fopen function in PHP. The problem is that I have to change the file permissions to do so.
I have tried using the chmod function in PHP but it doesn't work.
Code is something like this
This returns an error saying...Warning: chmod() [function.chmod]: Operation not permitted.....
Would this mean that chmod isn't enabled on my hosting? I know the PHP script works fine on a local testing server but when it went live it didn't play ball. Eventually I want it to run at set intervals itself so I need the permissions sorted first.
I am guessing that I want to firstly set the permissions to 0777, write to file and then reset permissions to 0644. Is this correct?
Thanks
I have an RSS generation script which I use to open a file using fopen function in PHP. The problem is that I have to change the file permissions to do so.
I have tried using the chmod function in PHP but it doesn't work.
Code is something like this
Code:
chmod("/somedir/somefile", 0755);
This returns an error saying...Warning: chmod() [function.chmod]: Operation not permitted.....
Would this mean that chmod isn't enabled on my hosting? I know the PHP script works fine on a local testing server but when it went live it didn't play ball. Eventually I want it to run at set intervals itself so I need the permissions sorted first.
I am guessing that I want to firstly set the permissions to 0777, write to file and then reset permissions to 0644. Is this correct?
Thanks
Last edited: