PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi, a fairly standard question I would have thought although I'm struggling to find an answer:
I'm running a webpage on a space allocated to me by my university and I'm trying to write information to a file. I can read a file alright, but whenever I try to wirte to a file, it says I don't have permission. So I tried editting the permissions in the properties window of an existing file in my folder and writing to that- still no luck, infact for some reason another two copies of the file I had just changed the permissions for suddenly appeared in my folder but were unaccessible.
After doing some reading on the net I gathered that I have to edit CHMOD or change something in IIS. But because I'm not running the server myself, is that what I should do? Cos the other thing I noticed was on the phpInfo() page there was a column for 'Local' and 'Master' configurations which made me wonder whether the permissions I need (what ever they are) can be editted just for me and possibly by me. Am I close? Any help would be much appreciated.
Last edited by Hoopla! on Fri Jul 28, 2006 10:51 am, edited 1 time in total.
ole wrote:well you must have ftp access to be able to run a script on the server, you can usually chmod with a good ftp client.
Well I do have ftp access, thats how I upload all my files for the webpage. But I have no idea what CHMOD is and where you find it. Also, what is php.ini? I read about that too. Is it something that I can access and if so how?
go to properties of a file or directory in your ftp client and you should be able to change permissions there.
chmod is the name of the program that is used to do this from a linux/unix terminal and some ftp clients label permission changing as chmod, which is why i mentioned it.
Well I tried it again. I set the checkboxes for Read and Write for Group permission to true and this time they stayed that way - with no extra copies of the file, which was an improvement. And the PHP page responds to the Read flag being checked or unchecked, but regardless of the state of the Write flag, PHP always sends back the error: Warning: fopen(Downloaders.txt): failed to open stream: Permission denied in /home/03/541737/public_html/Test.php on line 15
I suggest you try FlashFXP to connect to your FTP-account (it's very easy to use)
Then right click the file, select CHMOD and for a starter set everything true (even group)
or type 0777 in the textbox.
CHMOD the files and see in your log (right bottom) that the CHMOD command was succesful.
Nah still doesn't like it, checked all boxes and it didn't do anything different. Thanks anyway, and you're right FlashFXP is easy to use. I'll try contacting the web admin.