hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Permissions Help!
Reply

Forum Jump

Permissions Help!

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-16-2002, 08:02 PM
chads2k2 chads2k2 is offline
Newbie
 
Join Date: Sep 2002
Location: Columbus, OH
Posts: 5

Permissions Help!


Ok... I am having a lot of trouble with file permissions now. It seems to be hating me. So that isnt really good. I do not have root access and it wouldnt let me chown it either. SO WTF??

Here is my scripting:

mkdir.php
---------------------------------------
<?php
function createhost($dir) {
mkdir($dir, "777");
$site = "http://www.brokenformula.com/stat.php";
$id = "6";
$bannerlne1 = "Chris Crothers";
$bannerlne2 = "740.881";
$html="<html><head><meta http-equiv='Content-Language' content='en-us'><meta http-equiv='Content-Type'content='text/html; charset=windows-1252'><title>Live Sales Clerk</title></head><body topmargin='0' leftmargin='0'><table border='0' width='100%%' height='100%%' cellspacing='0' cellpadding='0'><tr><td width='100%%' valign='top' height='491'><iframe src='$site' border='0' height='100%%' width='100%%' name='content'></iframe></td></tr><tr><td width='100%%' valign='top' height='61'><table border='0' width='100%%' height='100%%' cellspacing='0' cellpadding='0'><tr><td width='21%%' bgcolor='#000080'><p align='center'><img border='0' src='http://www.domain.com/images/BannerLeft2.GIF'></td><td width='57%%' valign='top' bgcolor='#000080'><p align='center'><font color='#FFFFFF' size='4'>$bannerlne1<br>$bannerlne2</font></td><td width='22%%' bgcolor='#000080'><p align='center'><a href='http://www.domain.com/demo.php?id=$id'><img border='0' src='http://www.domain.com/images/BannerRight2.GIF'></a></td></tr></table></td></tr></table></body></html>";
//$file = fopen("index.php", "a+");
//fwrite ($file,$html);
//fclose($file);
}
$email = "blah@brokenformula.com";
createhost("./$email");
?>
------------------------------
end of mkdir.php



output of file permissions
--------------------------------
total 40
drwxr-Sr-t 2 nobody livesale 4096 Sep 16 18:43 blah@brokenformula.com
drwxrwsr-x 2 livesale livesale 4096 Sep 16 18:57 chad
d-w--wx-wT 2 nobody livesale 4096 Sep 16 18:09 chadsmith@brokenformula.com
drwsrwxrwt 2 nobody livesale 4096 Sep 16 18:17 chriscrothers@brokenformula.com
-rw-rw-r-- 1 livesale livesale 1229 Sep 16 17:40 createfile.php
d-w--wx-wT 2 nobody livesale 4096 Sep 16 17:48 help
-rw-r--r-- 1 nobody livesale 1102 Sep 16 18:34 index.php
-rw-rw-r-- 1 livesale livesale 1447 Sep 16 18:43 mkdir.php
-rw-rw-r-- 1 livesale livesale 231 Sep 16 17:30 showsource2.php
-rw-rw-r-- 1 livesale livesale 149 Sep 16 17:31 showsource.php
---------------------------------
end of output of file permissions


I cannot delete directories or anything b/c they have stuff in them. Well I go in with my FTP program and it says there isnt anything in there. So... i SSHed into the box and tried going to the folder and it said I do not have permission. I know its because I do not "own" it. Well I tried to do a chown livesalesclerk help and it said that I didnt have permission. SO... WTF? I don't have root access to the box either. Its on a shared server. Great company we are with its just I don't think I know what I am doing. So is there something that I can do? Thanks!

Chad R. Smith



Sponsored Links
  #2  
Old 09-17-2002, 08:13 AM
PencWeb PencWeb is offline
Aspiring Evangelist
 
Join Date: Mar 2001
Posts: 351
to create a dir it's:

mkdir("the_dir", 0777);

  #3  
Old 09-17-2002, 04:41 PM
Chr1s Chr1s is offline
Junior Guru Wannabe
 
Join Date: Sep 2002
Location: Canada
Posts: 35
Quote:

function createhost($dir) {
mkdir($dir, "777");
PHP Code:
function createhost($dir) { 
mkdir("$dir"0777); 

__________________
EZScripts - Quality PHP Scripts, Low Price (includes Custom Scripting on request.)
http://www.EZScripts.net/

Sponsored Links
  #4  
Old 09-17-2002, 04:44 PM
chads2k2 chads2k2 is offline
Newbie
 
Join Date: Sep 2002
Location: Columbus, OH
Posts: 5
One problem is still who owns the folder. It keeps saying "nobody" where it should be livesalesclerk.... any way to fix that?

Chad

  #5  
Old 09-19-2002, 10:59 AM
jwalk76 jwalk76 is offline
New Member
 
Join Date: Sep 2002
Posts: 1
php has been installed as an apache module. when this is the case, all scripts run as the user that the apache daemon runs as...quite often this is "nobody" or "apache" or "www". so, when you run "mkdir" the directory will be created with the ownership of the user that runs the apache daemon. as far as i know, there is no way around this....

  #6  
Old 09-19-2002, 11:40 AM
chads2k2 chads2k2 is offline
Newbie
 
Join Date: Sep 2002
Location: Columbus, OH
Posts: 5
YOU ROCK MAN! I didn't know that at all! We do have a www folder but it does run as "Nobody". I was thinking there had to be a way to do a chown or something that could be done. But our server wouldnt take that either. I think its kinda crap though. Php should built something into it (I would but no idea how) so we can run chown's on the folders except we cannot put them to "Root" b/c that would REALLY fk things up eh? Ok man take it easy and thanks again!

Chad

Reply

Related posts from TheWhir.com
Title Type Date Posted
Providing Healthcare Hosting Services Under the HIPAA Omnibus Final Rule Web Hosting News 2013-09-20 18:13:44
Network Solutions Customers Face Access Issues Following DDoS Attacks Web Hosting News 2013-07-24 15:28:25
Tier 3 Launches Global Cloud Object Storage with Automated Data Center Redundancy Web Hosting News 2013-06-19 12:44:58
Cloud File Sharing Software ownCloud Launches Beta of Updated Community Version Web Hosting News 2012-09-04 17:09:04
Mimecast Email Security Updates Give Users, IT Departments More Control Web Hosting News 2012-08-02 17:32:44


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?