directory permissions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • johnmark@fastermail.com

    directory permissions

    How does one set directory permissions in PHP? The manual only refers
    to chmod function changing permissions for files. I try to use it for
    directories but it didn't work.

    John

  • Andy Hassall

    #2
    Re: directory permissions

    On 21 Nov 2006 11:37:08 -0800, johnmark@faster mail.com wrote:
    >How does one set directory permissions in PHP? The manual only refers
    >to chmod function changing permissions for files. I try to use it for
    >directories but it didn't work.
    In what way did it not work? Because that's the correct function to use.

    --
    Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
    http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

    Comment

    • jkmambo@gmail.com

      #3
      Re: directory permissions


      Andy Hassall wrote:
      On 21 Nov 2006 11:37:08 -0800, johnmark@faster mail.com wrote:
      >
      How does one set directory permissions in PHP? The manual only refers
      to chmod function changing permissions for files. I try to use it for
      directories but it didn't work.
      >
      In what way did it not work? Because that's the correct function to use.
      >
      --
      Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
      http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
      Here is the statement I am running
      chmod(./directoryname/, 0777)

      Comment

      • Kim André Akerø

        #4
        Re: directory permissions

        jkmambo@gmail.c om wrote:
        Andy Hassall wrote:
        On 21 Nov 2006 11:37:08 -0800, johnmark@faster mail.com wrote:
        How does one set directory permissions in PHP? The manual only
        refers to chmod function changing permissions for files. I try to
        use it for directories but it didn't work.
        In what way did it not work? Because that's the correct function
        to use.
        >
        Here is the statement I am running
        chmod(./directoryname/, 0777)
        You ARE enclosing the directory path in quotes, right?

        chmod("./directoryname/", 0777);

        --
        Kim André Akerø
        - kimandre@NOSPAM betadome.com
        (remove NOSPAM to contact me directly)

        Comment

        • johnmark@fastermail.com

          #5
          Re: directory permissions

          Yes, I am enclosing the directoryname with quotes

          John

          Kim André Akerø wrote:
          jkmambo@gmail.c om wrote:
          >
          Andy Hassall wrote:
          On 21 Nov 2006 11:37:08 -0800, johnmark@faster mail.com wrote:
          >
          How does one set directory permissions in PHP? The manual only
          refers to chmod function changing permissions for files. I try to
          use it for directories but it didn't work.
          >
          In what way did it not work? Because that's the correct function
          to use.
          Here is the statement I am running
          chmod(./directoryname/, 0777)
          >
          You ARE enclosing the directory path in quotes, right?
          >
          chmod("./directoryname/", 0777);
          >
          --
          Kim André Akerø
          - kimandre@NOSPAM betadome.com
          (remove NOSPAM to contact me directly)

          Comment

          • Gordon Burditt

            #6
            Re: directory permissions

            >How does one set directory permissions in PHP? The manual only refers
            >to chmod function changing permissions for files. I try to use it for
            >directories but it didn't work.
            >>
            > In what way did it not work? Because that's the correct function to use.
            >>
            >Here is the statement I am running
            >chmod(./directoryname/, 0777)
            What is the owner of the directory?
            What user is the PHP process running as (e.g. 'apache', 'daemon', 'www', etc)?

            If these don't match, you can't change the permissions because the OS
            won't let PHP do it.


            Comment

            • johnmark@fastermail.com

              #7
              Re: directory permissions


              Gordon Burditt wrote:
              How does one set directory permissions in PHP? The manual only refers
              to chmod function changing permissions for files. I try to use it for
              directories but it didn't work.
              >
              In what way did it not work? Because that's the correct function to use.
              >
              >
              Here is the statement I am running
              chmod(./directoryname/, 0777)
              >
              What is the owner of the directory?
              What user is the PHP process running as (e.g. 'apache', 'daemon', 'www', etc)?
              >
              If these don't match, you can't change the permissions because the OS
              won't let PHP do it.
              The directory is under apache web root directory. Its currently set to
              755. I am running PHP under apache.

              Comment

              • johnmark@fastermail.com

                #8
                Re: directory permissions


                Gordon Burditt wrote:
                How does one set directory permissions in PHP? The manual only refers
                to chmod function changing permissions for files. I try to use it for
                directories but it didn't work.
                >
                In what way did it not work? Because that's the correct function to use.
                >
                >
                Here is the statement I am running
                chmod(./directoryname/, 0777)
                >
                What is the owner of the directory?
                What user is the PHP process running as (e.g. 'apache', 'daemon', 'www', etc)?
                >
                If these don't match, you can't change the permissions because the OS
                won't let PHP do it.
                The directory is under apache web root directory. Its currently set to
                755. I am running PHP under apache.

                Comment

                • Jerry Stuckle

                  #9
                  Re: directory permissions

                  johnmark@faster mail.com wrote:
                  Gordon Burditt wrote:
                  >
                  >>>>>How does one set directory permissions in PHP? The manual only refers
                  >>>>>to chmod function changing permissions for files. I try to use it for
                  >>>>>directorie s but it didn't work.
                  >>>>
                  >>>In what way did it not work? Because that's the correct function to use.
                  >>>>
                  >>
                  >>>Here is the statement I am running
                  >>>chmod(./directoryname/, 0777)
                  >>
                  >>What is the owner of the directory?
                  >>What user is the PHP process running as (e.g. 'apache', 'daemon', 'www', etc)?
                  >>
                  >>If these don't match, you can't change the permissions because the OS
                  >>won't let PHP do it.
                  >
                  >
                  The directory is under apache web root directory. Its currently set to
                  755. I am running PHP under apache.
                  >
                  But again, who is the owner? And what is the user Apache is running under?

                  --
                  =============== ===
                  Remove the "x" from my email address
                  Jerry Stuckle
                  JDS Computer Training Corp.
                  jstucklex@attgl obal.net
                  =============== ===

                  Comment

                  • Gordon Burditt

                    #10
                    Re: directory permissions

                    >How does one set directory permissions in PHP? The manual only refers
                    >to chmod function changing permissions for files. I try to use it for
                    >directories but it didn't work.
                    >>
                    > In what way did it not work? Because that's the correct function to use.
                    >>
                    >>
                    >Here is the statement I am running
                    >chmod(./directoryname/, 0777)
                    >>
                    >What is the owner of the directory?
                    >What user is the PHP process running as (e.g. 'apache', 'daemon', 'www', etc)?
                    >>
                    >If these don't match, you can't change the permissions because the OS
                    >won't let PHP do it.
                    >
                    >The directory is under apache web root directory.
                    AND WHAT USER OWNS IT? (Hint: under UNIX, "ls -ld" will tell you this.
                    Under PHP, the stat() or fileowner() function will give the numeric user id,
                    and the posix_getpwnam( ) function will translate that to a name.)
                    >Its currently set to
                    >755. I am running PHP under apache.
                    AS WHAT USER?
                    (Hint: under UNIX, various forms of ps will give the user name running
                    the 'httpd' or 'apache' process. )

                    Comment

                    Working...