SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Non-Member bronze trophy geniusgoalie's Avatar
    Join Date
    Sep 2004
    Location
    Buffalo, USA
    Posts
    979
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    well this is odd...

    I used this code in php:
    PHP Code:
    mkdir ("{$_SERVER['DOCUMENT_ROOT']}/{$username}"0755); 
    And permission was denied, but with this code:
    Code:
    mkdir ("$config{'root_dir'}/$in{'username'}", 0755)
    in perl, it worked!

    Anyone have any clue as to why this is, and how I may fix it?

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2004
    Location
    Madison, WI
    Posts
    191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you ran one over the web and the other command-line, then it could be due to the difference in users (ie. web-run scripts run as whatever the http daemon name is, and the daemon may or may not have different permissions than a console user)

  3. #3
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    Parry Sound, ON
    Posts
    725
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    perl CGI usually runs as the FTP user these days, via suexec, while PHP as a module runs as apache. i.e. you'll probably need the folder where you're creating new folders to be either owned by apache (the apache user, that is, maybe apache, maybe nobody) or chmod the container folder 777.

  4. #4
    Non-Member bronze trophy geniusgoalie's Avatar
    Join Date
    Sep 2004
    Location
    Buffalo, USA
    Posts
    979
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My host fixed the problem, which was that the script was owned by nobody, which had 0 permissions in the public_html folder. The only problem is that now I am not sure how to set all of my scripts like this!

  5. #5
    Non-Member bronze trophy geniusgoalie's Avatar
    Join Date
    Sep 2004
    Location
    Buffalo, USA
    Posts
    979
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, this is the idea- for the script, it would save a lot of trouble if I created the directory in perl, but did everything else in php. Are there any obvious problems with this?


Bookmarks

Posting Permissions

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