My PHP scripts can't write to Apache running as www-data??

Discussion in 'Apache' started by carlos123, Nov 16, 2009.

  1. #1
    I am having a big problem understanding how to work under Apache locally on my computer as I test a web site before I upload changes to a hosted server and would appreciate any input anyone might care to give me.

    Specifically...my PHP scripts cannot write to or create files in the document root of my local test domain.

    I am user 'carlos'. Apparently Apache (and I think PHP under it) run as user 'www-data'.

    Occasionally a file can be created that is owned by 'www-data' but I as user 'carlos' cannot edit it or make changes to it. Neither can my PHP scripts.

    I tried making user 'www-data' part of group 'carlos' and my user 'carlos' part of group 'www-data' to no avail.

    I am just utterly confused as to who is supposed to be who and who is supposed to be a part of who.

    I am just trying to get my PHP scripts to be able to write and create files under the Apache document root of my test domain.

    I have spent hours and hours Googling and otherwise trying to work around this by reading everything I could get my hands on regarding Linux permissions and I still can't figure it out.

    Any help would be appreciated.

    Thanks.

    Carlos
     
    carlos123, Nov 16, 2009 IP