Connecting Tech Pros Worldwide Help | Site Map

Problem with file permissions : PHP / FTP

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 01:09 AM
xxx
Guest
 
Posts: n/a
Default Problem with file permissions : PHP / FTP

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, 01:09 AM
elyob
Guest
 
Posts: n/a
Default 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, 01:09 AM
Matthias Esken
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.