Neptunus Maris Posted October 30, 2007 Share Posted October 30, 2007 I'm trying to create a user interface thing where when they join they get their own directory(named by their joining username) and the files to view content on are copied from a stored file directory...like if view_profile.php was in the stored directory then I copy the file over to the newly created directory for the user. I use this to create the new directory...as you all know: <?php $dir_path = $dir_username; //. "/"; $oldmask = umask(0); @mkdir($dir_path, 0777); umask($oldmask); ?> and then you the copy function to move all files over thats in the stored directory. BUT! when you try to view any page in the new user's directory I get this error: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@what.mysite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Does anybody know whats going on? Quote Link to comment https://forums.phpfreaks.com/topic/75362-whats-the-deal/ Share on other sites More sharing options...
Neptunus Maris Posted October 30, 2007 Author Share Posted October 30, 2007 is something to do with the .htaccess files...I've already tried something like that... Quote Link to comment https://forums.phpfreaks.com/topic/75362-whats-the-deal/#findComment-381178 Share on other sites More sharing options...
cooldude832 Posted October 30, 2007 Share Posted October 30, 2007 why would you do this? That is pointless, I don't know why its error, but why copy a bunch of files on the same server. Quote Link to comment https://forums.phpfreaks.com/topic/75362-whats-the-deal/#findComment-381182 Share on other sites More sharing options...
Neptunus Maris Posted October 30, 2007 Author Share Posted October 30, 2007 why would you do this? That is pointless, I don't know why its error, but why copy a bunch of files on the same server. Because I want the users to have their own directory... Quote Link to comment https://forums.phpfreaks.com/topic/75362-whats-the-deal/#findComment-381190 Share on other sites More sharing options...
cooldude832 Posted October 30, 2007 Share Posted October 30, 2007 but why would you copy generic files? Quote Link to comment https://forums.phpfreaks.com/topic/75362-whats-the-deal/#findComment-381191 Share on other sites More sharing options...
Neptunus Maris Posted October 30, 2007 Author Share Posted October 30, 2007 but why would you copy generic files? then how would people view a profile page within that selected user's directory? please enlighten me Quote Link to comment https://forums.phpfreaks.com/topic/75362-whats-the-deal/#findComment-381203 Share on other sites More sharing options...
cooldude832 Posted October 30, 2007 Share Posted October 30, 2007 Well I store all my user data in a database like normal people, and then I use a page like view.php?id=UserID and query the db for data. makes a ton more sense. Quote Link to comment https://forums.phpfreaks.com/topic/75362-whats-the-deal/#findComment-381212 Share on other sites More sharing options...
Neptunus Maris Posted October 30, 2007 Author Share Posted October 30, 2007 Well I store all my user data in a database like normal people, and then I use a page like view.php?id=UserID and query the db for data. makes a ton more sense. yeah i know how to do that stuff...but i just wanted each user to have his/her own directory Quote Link to comment https://forums.phpfreaks.com/topic/75362-whats-the-deal/#findComment-381216 Share on other sites More sharing options...
atlanta Posted October 30, 2007 Share Posted October 30, 2007 The reason you get the error is because the server creates your folder as nobody i believe and you are giving it 777 chmod which web users arent allowed to access this .. you want to chown the folder to your webuser name. Check you Ftp program and look at the owner field if u have one it should have a number and if the new folder has 0 then that is the problem above But like cooldude832 said you should use the DB that way and just allow them to have a directory for space ... the method you are using is pretty senseless! Quote Link to comment https://forums.phpfreaks.com/topic/75362-whats-the-deal/#findComment-381222 Share on other sites More sharing options...
aschk Posted October 30, 2007 Share Posted October 30, 2007 I'm guessing that this will be running as the Apache user unless you have the PHP equivalent of suexec (suPHP anyone?) so all your files/permissions will be written or done as that user. Thus you cannot chown (to my knowledge) as Apache, because if you could, you would be able to chown apache:apache / bringing the whole server to a standstill. Quote Link to comment https://forums.phpfreaks.com/topic/75362-whats-the-deal/#findComment-381234 Share on other sites More sharing options...
atlanta Posted October 30, 2007 Share Posted October 30, 2007 Well i know when i made a upload script a while back it created the folder as owner = 0 Quote Link to comment https://forums.phpfreaks.com/topic/75362-whats-the-deal/#findComment-381240 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.