rajmohan Posted November 2, 2006 Share Posted November 2, 2006 i am trying to create a folder. In that folder i try to create a file through coding it is executing well in my local host but it is not working in my server$dir = "template/$company"; // getting the name of the foldermkdir($dir, 0777); $createfile = "index.php"; $file = fopen("template/$company/".$createfile, 'w+') or die("can't open file"); fclose($file);i receive error like this while executing in my serverWarning: SAFE MODE Restriction in effect. The script whose uid is 10056 is not allowed to access /home/httpd/vhosts/buscandomusicos.com/httpdocs/template/xxx owned by uid 48 Quote Link to comment Share on other sites More sharing options...
rajmohan Posted November 2, 2006 Author Share Posted November 2, 2006 ANy one can solve this problem please Quote Link to comment Share on other sites More sharing options...
rajmohan Posted November 2, 2006 Author Share Posted November 2, 2006 safe mode problem i think so what should i want to do Quote Link to comment Share on other sites More sharing options...
joshi_v Posted November 2, 2006 Share Posted November 2, 2006 The file you are trying to create and the directory has different owner settings.If SAFE MODE is on , you can't access another user's files. So make sure that , the directory and the file you are tryign to create has the same uid's.Hope this helps you! Quote Link to comment Share on other sites More sharing options...
rajmohan Posted November 2, 2006 Author Share Posted November 2, 2006 Actually i want to create a folder for every customer in that folder i want to create a file called index.php. then i want to write some code inside that index.php through coding.if the customer give all the details this should be done. so now each customer will have seperate folder with index.php file insidei already showen the coding what i have done it is executing in localhost but not in server error was produced is there any new way Quote Link to comment Share on other sites More sharing options...
joshi_v Posted November 2, 2006 Share Posted November 2, 2006 First you tell me/home/httpd/vhosts/buscandomusicos.com/httpdocs/template/xxx What is the 'xxx' in above line? is it a file name?check whether you have permissions to create a new folder in server or not? Quote Link to comment Share on other sites More sharing options...
rajmohan Posted November 2, 2006 Author Share Posted November 2, 2006 yes xxx is the file name that is index.phpActually i created folder in my server but throughmkdir($foldername,0777);whenever i call this code it is creating a folder in different name but inside this folder i want to create a file name called index.php i wrote like this $createfile = "index.php";$file = fopen("template/$company/".$createfile, 'w+') or die("can't open file");fclose($file);but what happen folder is created but index.php file is not created that error was produced. Quote Link to comment Share on other sites More sharing options...
joshi_v Posted November 2, 2006 Share Posted November 2, 2006 As per as i know, I think there is a file already called index.php in template folder.That is not created by some another user.when you try to open a new file , it is trying to open the file in /templates/index.php. It is not going to the new folder.So have a try on this.$file = fopen("httpdocs/template/$company/".$createfile, 'w+') or die("can't open file");Good Luck! Quote Link to comment 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.