File permissions

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!

Moderator: General Moderators

Post Reply
Hoopla!
Forum Newbie
Posts: 5
Joined: Fri Jul 28, 2006 4:43 am

File permissions

Post by Hoopla! »

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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Have you talked to the university hosting staff?
Hoopla!
Forum Newbie
Posts: 5
Joined: Fri Jul 28, 2006 4:43 am

Post by Hoopla! »

feyd wrote:Have you talked to the university hosting staff?
No I haven't I was hoping it was something I could fix myself. So contacting them is the only way?
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

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.
Hoopla!
Forum Newbie
Posts: 5
Joined: Fri Jul 28, 2006 4:43 am

Post by Hoopla! »

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?
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

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.
Hoopla!
Forum Newbie
Posts: 5
Joined: Fri Jul 28, 2006 4:43 am

Post by Hoopla! »

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
thiscatis
Forum Contributor
Posts: 434
Joined: Thu Jul 20, 2006 11:00 am

Post by thiscatis »

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.
Hoopla!
Forum Newbie
Posts: 5
Joined: Fri Jul 28, 2006 4:43 am

Post by Hoopla! »

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.
Post Reply