Problem with file permissions : PHP / FTP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • xxx

    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


  • elyob

    #2
    Re: Problem with file permissions : PHP / FTP


    "xxx" <xxx@pi.be> wrote in message
    news:WiRtb.2730 2$_q2.997434@ph obos.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.



    Comment

    • Matthias Esken

      #3
      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

      Comment

      Working...