Connecting Tech Pros Worldwide Help | Site Map

Problem with file permissions : PHP / FTP

  #1  
Old July 17th, 2005, 02:09 AM
xxx
Guest
 
Posts: n/a
Hello,

My php-script makes directories and puts files in it.
But via FTP'ing, I can't delete those files anymore.

Also, I need to put a whole bunch of existing files into these,
'made-by-php' directories, and that seems impossible
by means of FTP. I get an 'access denied' error every time.

Has anyone come accross the same problem and maybe
have a solution to it ? Thanks !

Steven Braeckevelt


  #2  
Old July 17th, 2005, 02:09 AM
elyob
Guest
 
Posts: n/a

re: Problem with file permissions : PHP / FTP



"xxx" <xxx@pi.be> wrote in message
news:WiRtb.27302$_q2.997434@phobos.telenet-ops.be...[color=blue]
> Hello,
>
> My php-script makes directories and puts files in it.
> But via FTP'ing, I can't delete those files anymore.
>
> Also, I need to put a whole bunch of existing files into these,
> 'made-by-php' directories, and that seems impossible
> by means of FTP. I get an 'access denied' error every time.
>
> Has anyone come accross the same problem and maybe
> have a solution to it ? Thanks !
>
> Steven Braeckevelt
>
>[/color]

The permissions have been set by the system. You'll need to get the person
with root password to delete them, or write another script to delete the
files you don't want.



  #3  
Old July 17th, 2005, 02:09 AM
Matthias Esken
Guest
 
Posts: n/a

re: Problem with file permissions : PHP / FTP


"xxx" <xxx@pi.be> schrieb:
[color=blue]
> My php-script makes directories and puts files in it.
> But via FTP'ing, I can't delete those files anymore.[/color]

The PHP system user is not the same user that accesses the files via
FTP. So your FTP user can't use those directories and files created by
the PHP user. The term "user" means a Unix user, not the person behind
the keyboard.
[color=blue]
> Also, I need to put a whole bunch of existing files into these,
> 'made-by-php' directories, and that seems impossible
> by means of FTP. I get an 'access denied' error every time.[/color]

Change the access rules for the files and directories with PHP. You can
do this with chmod(). With chmod('foo/bar', 0777) the files will be
accessible for the whole wide world. For further details see the manual
at http://www.php.net/manual/en/function.chmod.php.

Regards,
Matthias
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with uploading image swethak answers 2 March 26th, 2009 11:01 AM
file creation: ownership jonathanmcdougall@gmail.com answers 6 August 31st, 2005 06:55 PM
Safe Mode & File Upload pdav answers 4 July 17th, 2005 12:55 PM
what the heck does "permissions 33279" mean? lkrubner@geocities.com answers 15 July 17th, 2005 11:04 AM