Find the answer to your Linux question:
Results 1 to 4 of 4
Hello, I am trying to host a website but I seem to be having a ton of problems with permissions. I have a second user, in the root usergroup, that ...
  1. #1
    Just Joined!
    Join Date
    Nov 2009
    Posts
    14

    /var/www/ Permissions problems

    Hello,

    I am trying to host a website but I seem to be having a ton of problems with permissions. I have a second user, in the root usergroup, that has control of the /var/www/ directory for where my sites are hosted (I have a few virtual sites that are hosted inside of the www directory). The problem that I have is when my php script tries to create a folder, it creates the folder under the www-data username and usergroup, apache's default username/group I assume.

    The problem with this is when my php script tries to create a directory/move a file, it is issuing me gobs of errors stating it doesn't have correct permissions. For example, when I run the mkdir( 'myfolder', 0777); command in a php script, it will only make a folder with the max permissions of 0755.

    What would you recommend to fix this problem?

    Thanks in advance,
    noop

  2. #2
    Just Joined!
    Join Date
    Dec 2009
    Posts
    9
    just add below in your php scrip:

    mkdir("myfolder",0777);
    chmod("myfolder",0777);

    it can change your permission to rwxrwxrwx

  3. #3
    Just Joined!
    Join Date
    Nov 2009
    Posts
    14
    The folder still remains at 755

  4. #4
    Just Joined!
    Join Date
    Dec 2009
    Posts
    9
    try this:
    #chmod 777 /var/www
    #chown www-data /var/www

    n add this:

    Quote Originally Posted by joe_cuek View Post
    just add below in your php scrip:

    mkdir("myfolder",0777);
    chmod("myfolder",0777);

    it can change your permission to rwxrwxrwx
    it work in my compiz..
    try to check via terminal

    #ls -l /var/www

Posting Permissions

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