creating directories

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

    creating directories

    when I create directory with mkdir() in PHP script I can't create any
    more directory inside that script

    I try to aplay 0777 to mkdir and chmod with no success

    I think the problem is with safe_mod and wrong uid

    how to solve this problem?

    Thank you
  • Gale

    #2
    Re: creating directories

    I try webadmin.php - a simple Web-based file manager by Daniel Wacker
    and i get the same problem

    directories created by FTP have owner: "usernmame" group: ftponly
    directories created by script has owner: wwwrun group: www

    when I create directory by script, I have no privilegies to vreate
    another directory inside the new directory

    Please help!

    Comment

    • s

      #3
      Re: creating directories

      On Sat, 01 Apr 2006 02:16:46 +0200, Gale <gale@rules.d a> wrote:
      [color=blue]
      >I try webadmin.php - a simple Web-based file manager by Daniel Wacker
      >and i get the same problem
      >
      >directories created by FTP have owner: "usernmame" group: ftponly
      >directories created by script has owner: wwwrun group: www
      >
      >when I create directory by script, I have no privilegies to vreate
      >another directory inside the new directory
      >
      >Please help![/color]

      Use your FTP program to set the permissions on the target directory to
      777. Then, your PHP script should be able to create files and
      directories inside. If your FTP program doesn't have a
      chmod/permission option, download WS_FTP.

      hth

      --
      <s@guerril.la.a pe> (to email, remove .ape)
      --

      Comment

      • Gale

        #4
        Re: creating directories

        s wrote:[color=blue]
        > On Sat, 01 Apr 2006 02:16:46 +0200, Gale <gale@rules.d a> wrote:
        >[color=green]
        >> I try webadmin.php - a simple Web-based file manager by Daniel Wacker
        >> and i get the same problem
        >>
        >> directories created by FTP have owner: "usernmame" group: ftponly
        >> directories created by script has owner: wwwrun group: www
        >>
        >> when I create directory by script, I have no privilegies to vreate
        >> another directory inside the new directory
        >>
        >> Please help![/color]
        >
        > Use your FTP program to set the permissions on the target directory to
        > 777. Then, your PHP script should be able to create files and
        > directories inside. If your FTP program doesn't have a
        > chmod/permission option, download WS_FTP.
        >
        > hth
        >
        > --
        > <s@guerril.la.a pe> (to email, remove .ape)
        > --
        >[/color]


        I did that on first directory I created in FTP

        If I create directory by script I can't set chmod by FTP because it's
        diferrent uid.

        I'm thinking of using ftp_mkdir()

        can I set ftp_chmod() on directories or only on files ?

        Comment

        • John Murtari

          #5
          Re: creating directories

          Gale <gale@rules.d a> writes:
          [color=blue]
          > I try webadmin.php - a simple Web-based file manager by Daniel Wacker
          > and i get the same problem
          >
          > directories created by FTP have owner: "usernmame" group: ftponly
          > directories created by script has owner: wwwrun group: www
          >
          > when I create directory by script, I have no privilegies to vreate
          > another directory inside the new directory
          >
          > Please help![/color]

          What you have to understand is that your PHP scripts are
          executing under the same userid as the webserver. Nothing you can
          do is going to change that or allow you to create files owned by
          your username from a PHP script on that server. I assume you are in
          a 'shared hosting' environment and don't have any immediate control
          over the userid/group used by the web server.

          Your only option is to use FTP and manually fix stuff
          later; OR, your hosting provider may support PERL execution through
          CGI scripts and may have 'suexec' enabled. That would allow a PERL
          script to run under your userid/group. Then, from PHP you could
          invoked that PERL script to create directories that would be owned
          by you.

          Hope this helps.

          --
          John
          _______________ _______________ _______________ _______________ _______
          John Murtari Software Workshop Inc.
          jmurtari@follow ing domain 315.635-1968(x-211) "TheBook.Co m" (TM)
          Own TheBook.com today. Secure checkout and guided transfer support. No hidden fees.

          Comment

          Working...