Connecting Tech Pros Worldwide Help | Site Map

Problem with file permissions : PHP / FTP

xxx
Guest
 
Posts: n/a
#1: Jul 17 '05
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


elyob
Guest
 
Posts: n/a
#2: Jul 17 '05

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.



Matthias Esken
Guest
 
Posts: n/a
#3: Jul 17 '05

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