Problem creating file and permission

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
dimxasnewfrozen
Forum Commoner
Posts: 84
Joined: Fri Oct 30, 2009 1:21 pm

Problem creating file and permission

Post by dimxasnewfrozen »

Code: Select all

mkdir($creation_dir, 0775);

$index_file    = $creation_dir."/index.php";

$fh = fopen($index_file, 'w') or die("can't open file");
I can make the directory fine. And the file gets created fine as well. I am just wondering how I can create the permission for the file.

Once I create the file, I don't have permission to do anything to it since it's created by the server and server group haha
dimxasnewfrozen
Forum Commoner
Posts: 84
Joined: Fri Oct 30, 2009 1:21 pm

Re: Problem creating file and permission

Post by dimxasnewfrozen »

Bleh nevermind, I got it..

Code: Select all


chmod($index_file, 0775);
chmod($creation_dir, 0775);

had to manually change them as the server user.
Post Reply