So in summary this can't be done due to permission problems?

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default So in summary this can't be done due to permission problems?

    As part of a CMS I wanted to get the user to:
    1) Create a new recordset via a form (with a uniqueid).
    2) Press submit whereupon php gets the ID of the record just created in
    the DB, writes a new page to the server with that unique id and saves it
    as a filename determined by the user.

    No way around that due to permission settings on the webroot?

    So there is no way that PHP can write to the server unless the directory
    it's writing in is executable?
    Thanks for continued help.
    Cheers,

    Steve Jackson
    Web Development and Marketing Manager
    Viola Systems Ltd.
    [url]http://www.violasystems.com[/url]
    [email]stephen.jackson@violasystems.com[/email]
    Mobile +358 50 343 5159

    Steve Jackson Guest

  2. Similar Questions and Discussions

    1. permission problems -help!!
      Hi, Im trying to set permissions on my text files to 666. I downloaded the extension to do it via dreamweaver, but every time I try and change the...
    2. ASP.NET permission problems from a network share
      Hi there, I have a new win 2003 web server and having troubles setting up .NET. Im getting the following error from my applications: ...
    3. [PHP] So in summary this can't be done due to permission problems?
      > -Why the concern about letting that user have execute permissions, The permissions are Read, Write, and Execute. Read and Write are self...
    4. Re[2]: [PHP] So in summary this can't be done due to permission problems?
      --- Burhan Khalid <phplist@meidomus.com> wrote: Understood. Understood as well. I guess I have two questions, then. 1-What is the risk of...
    5. Permission Problems revisited
      Thanks for all the answers. I'm still somewhat in the fog. The installation owner is 'oracle'. User A is a different user. And still I would like...
  3. #2

    Default Re: [PHP] So in summary this can't be done due to permission problems?


    --- Steve Jackson <stephen.jackson@violasystems.com> wrote:
    > As part of a CMS I wanted to get the user to:
    > 1) Create a new recordset via a form (with a uniqueid).
    > 2) Press submit whereupon php gets the ID of the record just
    > created in
    > the DB, writes a new page to the server with that unique id and
    > saves it
    > as a filename determined by the user.
    >
    > No way around that due to permission settings on the webroot?
    >
    > So there is no way that PHP can write to the server unless the
    > directory
    > it's writing in is executable?
    That is correct. According to the docs, if the directory is not
    executable, you can't even get the permissions on the files in it.
    I'm confused, though.

    Let me state at the begining that I'm not a linux guy. Learning, but
    slowly.

    -Doesn't PHP run as some user?

    -Is the issue giving that user execute permissions in the web root?

    -Why the concern about letting that user have execute permissions,
    and then prevent anyone (execpt those that have valid reasons) from
    having write/execute permission to the webroot.

    Am I missing something basic? Quite possibly...


    =====
    Mark Weinstock
    [email]mark_weinstock@yahoo.com[/email]
    ***************************************
    You can't demand something as a "right" unless you are willing to fight to death to defend everyone else's right to the same thing.
    ***************************************

    __________________________________
    Do you Yahoo!?
    SBC Yahoo! DSL - Now only $29.95 per month!
    [url]http://sbc.yahoo.com[/url]
    Mark Guest

  4. #3

    Default Re[2]: [PHP] So in summary this can't be done due to permission problems?

    On Friday, July 11, 2003, 5:07:49 PM, Mark wrote:

    [ snip ]

    M> That is correct. According to the docs, if the directory is not
    M> executable, you can't even get the permissions on the files in it.
    M> I'm confused, though.

    M> Let me state at the begining that I'm not a linux guy. Learning, but
    M> slowly.

    M> -Doesn't PHP run as some user?

    PHP runs with the same permissions as Apache.

    M> -Is the issue giving that user execute permissions in the web root?

    If Apache cannot create a file in a directory, then PHP can't do it
    either.

    M> -Why the concern about letting that user have execute permissions,
    M> and then prevent anyone (execpt those that have valid reasons) from
    M> having write/execute permission to the webroot.

    I don't think the problem is with execute permissions. It just needs
    to be able to write and read from a directory, not necessarily
    execute. Although I'm not too sure about this.

    M> Am I missing something basic? Quite possibly...

    This isn't the easiest of things...



    --
    Regards,
    Burhan Khalid
    phplist[at]meidomus[dot]com
    [url]http://www.meidomus.com[/url]

    Burhan Khalid Guest

  5. #4

    Default Re: [PHP] So in summary this can't be done due to permission problems?

    File and directory permissions (so that people searching the archives have
    something to look for).
    > That is correct. According to the docs, if the directory is not
    > executable, you can't even get the permissions on the files in it.
    > I'm confused, though.
    1) To be able to _access_ a directory and its contents you need at minimum,
    execute permissions, on all directories in the path.

    2) To be able to create files (ie write _new_ files) in a directory, you need
    write permission for the directory in which the file is to be created (as
    well as (1)).

    3) To be able to change the contents of existing files you need (1) and you
    need write permissions on the file that you want to change.

    4) To be able to rename files, you need (1) and read permissions on the source
    files and (2) on the destination directory.

    5) To be able to _list_ the contents of a directory (as opposed to just having
    _access_) then you need (1) and read permissions on that directory.

    > -Doesn't PHP run as some user?
    Yes, usually as the user which runs the webserver.
    > -Is the issue giving that user execute permissions in the web root?
    Not just execute, you need write as well.
    > -Why the concern about letting that user have execute permissions,
    > and then prevent anyone (execpt those that have valid reasons) from
    > having write/execute permission to the webroot.
    Because in many shared-hosting environments, such an arrangement will mean
    that your fellow co-hosts will be able to read/write/trash files in your web
    space.

    That is why it was suggested that the OP used the FTP functions to write the
    files into his own web space.

    --
    Jason Wong -> Gremlins Associates -> [url]www.gremlins.biz[/url]
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    ------------------------------------------
    Search the list archives before you post
    [url]http://marc.theaimsgroup.com/?l=php-general[/url]
    ------------------------------------------
    /*
    Stone's Law:
    One man's "simple" is another man's "huh?"
    */

    Jason Wong Guest

  6. #5

    Default Re: [PHP] So in summary this can't be done due to permission problems?

    Thanks to all who explained it to me. Sorry if I inadvertently
    hijacked the thread.

    --- Jason Wong <php-general@gremlins.biz> wrote:
    > File and directory permissions (so that people searching the
    > archives have
    > something to look for).
    >
    > > That is correct. According to the docs, if the directory is not
    > > executable, you can't even get the permissions on the files in
    > it.
    > > I'm confused, though.
    >
    > 1) To be able to _access_ a directory and its contents you need at
    > minimum,
    > execute permissions, on all directories in the path.
    >
    > 2) To be able to create files (ie write _new_ files) in a
    > directory, you need
    > write permission for the directory in which the file is to be
    > created (as
    > well as (1)).
    >
    > 3) To be able to change the contents of existing files you need (1)
    > and you
    > need write permissions on the file that you want to change.
    >
    > 4) To be able to rename files, you need (1) and read permissions on
    > the source
    > files and (2) on the destination directory.
    >
    > 5) To be able to _list_ the contents of a directory (as opposed to
    > just having
    > _access_) then you need (1) and read permissions on that directory.
    >
    >
    > > -Doesn't PHP run as some user?
    >
    > Yes, usually as the user which runs the webserver.
    >
    > > -Is the issue giving that user execute permissions in the web
    > root?
    >
    > Not just execute, you need write as well.
    >
    > > -Why the concern about letting that user have execute
    > permissions,
    > > and then prevent anyone (execpt those that have valid reasons)
    > from
    > > having write/execute permission to the webroot.
    >
    > Because in many shared-hosting environments, such an arrangement
    > will mean
    > that your fellow co-hosts will be able to read/write/trash files in
    > your web
    > space.
    >
    > That is why it was suggested that the OP used the FTP functions to
    > write the
    > files into his own web space.
    >
    > --
    > Jason Wong -> Gremlins Associates -> [url]www.gremlins.biz[/url]
    > Open Source Software Systems Integrators
    > * Web Design & Hosting * Internet & Intranet Applications
    > Development *
    > ------------------------------------------
    > Search the list archives before you post
    > [url]http://marc.theaimsgroup.com/?l=php-general[/url]
    > ------------------------------------------
    > /*
    > Stone's Law:
    > One man's "simple" is another man's "huh?"
    > */
    >
    >
    > --
    > PHP General Mailing List ([url]http://www.php.net/[/url])
    > To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
    >

    =====
    Mark Weinstock
    [email]mark_weinstock@yahoo.com[/email]
    ***************************************
    You can't demand something as a "right" unless you are willing to fight to death to defend everyone else's right to the same thing.
    ***************************************

    __________________________________
    Do you Yahoo!?
    SBC Yahoo! DSL - Now only $29.95 per month!
    [url]http://sbc.yahoo.com[/url]
    Mark Guest

  7. #6

    Default Re: [PHP] So in summary this can't be done due to permission problems?

    > As part of a CMS I wanted to get the user to:
    > 1) Create a new recordset via a form (with a uniqueid).
    > 2) Press submit whereupon php gets the ID of the record just created in
    > the DB, writes a new page to the server with that unique id and saves it
    > as a filename determined by the user.
    Seriously, aren't you really just trying to re-invent sessions?

    A cookie tracks your session id, your php uses the session id to
    maintain persistent data on the visitor, you use the persistent data to
    customize the page that gets presented. You don't need to know about
    file permissions beyond setting up apache and php.

    If you want more than sessions can give you, then you probably want to
    set up a directory that is not underneath your web root (maybe under /var
    somewhere?) and is only accessible to your apache user. The functions to
    read and write files in that directory should be declared in include
    files, which should also not be underneath your web root.

    If you want to really tighten the lid down, you can set up a separate
    server process and communicate with it through local sockets instead of
    IP. Or you could install a database and configure the database to not listen
    to anything coming in over the network.

    --
    Joel Rees, programmer, Kansai Systems Group
    Altech Corporation (Alpsgiken), Osaka, Japan
    [url]http://www.alpsgiken.co.jp[/url]

    Joel Rees Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139