Page 1 of 1

Permissions help please

Posted: Thu Apr 14, 2005 7:12 pm
by mjseaden
Hi there,

One of my PHP scripts, strangely enough, generates PHP code and saves to a .php file in my public_html directory (Linux Apache server).

I initially had my permissions set to 757, which gave me permissions errors when trying to use fopen() to open a file for writing in my public_html directory.

So, I've temporarily (very temporarily!) set the permissions to 777 so that I can write. However, what's the best permissions to set my public_html directory to so my PHP scripts, run on the server, can write to public_html but won't leave my public_html directory completely vulnerable to hackers.

Many thanks

Mark

Posted: Thu Apr 14, 2005 7:36 pm
by evilmonkey
Hi Mark,

Why don't you just set the permissions of the file you want to write to? If every run of the script creates a new file, I suggest creating a directory within public_html and setting that to 777.

Good luck.