...

View Full Version : mkdir() and file permissions



Michiel
03-20-2004, 06:16 PM
Hi there,

I'm having some troubles with the mkdir function and the file permissions. I've got the following code in my script:



mkdir($this->_aConfig['path'], 0644);


This is supposed to create a new directory that is readible and writeble for the php-script itself. So I want to be able to create files and sub-derictories inside this newly created directory.

The directory is in fact being made. However the file permissions appear to be 550 (according to WS-FTP). So the script is not allowed to write in the directory ....

Can anyone tell me how I should change the code, for it to work?

Thanx in advance! Michiel

firepages
03-22-2004, 03:56 AM
can't see why the mode changes unless its something sneaky your host does ?

regardless try chmodding to something wide open..



<?
mkdir($dir,0777);
?>
create any files or folders you want, then lock it up.
<?
chmod($dir,0644);
?>


now that is no more likely to work as your original ,butwho knows ?

mr_ego
03-22-2004, 07:12 AM
i've had some problems with the chmod() function. so try:

mkdir($this->dirname);
system("chmod 777 " $this->dirname);



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum