bbunlock Posted April 11, 2008 Share Posted April 11, 2008 Hi there im hoping someone can help me with this little problem, im running an exec() command but it is failing becuase the command is not being run in the folder that stores the files, this is how I have things set I have a folder called create in which I have my php scripts (the one that calls the exec command), in that folder I have another folder called create_temp, the create_temp folder has the command files in it and also the files to process. if I was in the create_temp folder and ran the exec command all works fine, but becuase im in the create folder it fails becase one of the files the command files processes is looking for the files in the create folder. so basicaly im running the exec command like the following $make_file = "create_temp/system_command create_temp/created.mif create_temp/created_List.txt"; exec($make_mbm); system_command is the system command that exec is executing created.mif is the file that will be created when the exec command is run created_List.txt is the file system_command reads from now the problem is that the created_List.txt file has lines like the following in it. /c16,8 .\qsn_fr_status_flat.bmp .\ means current folder, but in this case its thinking the files are in the create folder becuase that is the folder the exec is being run from and if I change the lines in created_List.txt to the following it would work /c16,8 .\create_temp\qsn_fr_status_flat.bmp but the only problem is that created_List.txt is created from a previous exec command and isnt a static file so the way I see it I have 2 choices. 1, find a way to run the exec command and the system tool thinks its in the correct folder 2, after the created_List.txt is created on a previous exec command open it up via a php method and change all instances of ".\" to ".\create_temp\" one thing to note is that the system has "phpsuexec" running which means my php scripts cannot be run from a 777 folder and cannot have the 777 permission themselves if anyone has any suggestions on how to solve this I would be very greatfull regards wayne Link to comment https://forums.phpfreaks.com/topic/100678-solved-problem-running-exec/ Share on other sites More sharing options...
rhodesa Posted April 11, 2008 Share Posted April 11, 2008 Check out http://us.php.net/chdir Link to comment https://forums.phpfreaks.com/topic/100678-solved-problem-running-exec/#findComment-514942 Share on other sites More sharing options...
bbunlock Posted April 11, 2008 Author Share Posted April 11, 2008 a big thank you rhodesa that worked perfectly once again thank you very much regards wayne Link to comment https://forums.phpfreaks.com/topic/100678-solved-problem-running-exec/#findComment-514989 Share on other sites More sharing options...
geethalakshmi Posted April 18, 2008 Share Posted April 18, 2008 Hi, The below link gives you the solution for the Problems with functions like exec(). http://www.hiox.org/index.php?id=63 Regards Geethalakshmi http://www.hiox.org/ http://www.zxcvbnm.in/ Link to comment https://forums.phpfreaks.com/topic/100678-solved-problem-running-exec/#findComment-520229 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.