l0ve2hat3 Posted March 10, 2008 Share Posted March 10, 2008 I need to run "chmod 777 home/user/public_html -R" is there a way I can do this via exec or shell_exec functions? I've tried : <? shell_exec("chmod 777 /home/newharp/public_html/ -R"); ?> and had no luck Quote Link to comment Share on other sites More sharing options...
btherl Posted March 10, 2008 Share Posted March 10, 2008 What happens when you try that? Any error message? Blank page? Quote Link to comment Share on other sites More sharing options...
l0ve2hat3 Posted March 10, 2008 Author Share Posted March 10, 2008 blank Quote Link to comment Share on other sites More sharing options...
l0ve2hat3 Posted March 10, 2008 Author Share Posted March 10, 2008 im sorry i run this: <? $output = shell_exec("chmod 777 /home/newharp/public_html/ -R"); echo $output; ?> and i also tried: <? $output = exec("chmod 777 /home/newharp/public_html/ -R"); echo $output; ?> both returned empty variables Quote Link to comment Share on other sites More sharing options...
trq Posted March 10, 2008 Share Posted March 10, 2008 It is highly unlickely that the apache user has permissions to chmod /home/newharp/public_html/ even if it did, chmod'ing that directory to 777 would be a massive security hole. Quote Link to comment Share on other sites More sharing options...
l0ve2hat3 Posted March 10, 2008 Author Share Posted March 10, 2008 could i login as root from the shell_exec function? Quote Link to comment Share on other sites More sharing options...
l0ve2hat3 Posted March 10, 2008 Author Share Posted March 10, 2008 chmod'ing that directory to 777 would be a massive security hole. Well what permissions do I need for the php files to be able to write in that directory. could I get rid of the execute permission? Quote Link to comment Share on other sites More sharing options...
l0ve2hat3 Posted March 11, 2008 Author Share Posted March 11, 2008 can anybody help me? Quote Link to comment Share on other sites More sharing options...
discomatt Posted March 11, 2008 Share Posted March 11, 2008 tried this? http://php.net/chmod/ BTW - don't CHMOD 777 your webroot Quote Link to comment Share on other sites More sharing options...
l0ve2hat3 Posted March 11, 2008 Author Share Posted March 11, 2008 wow thank you. exactly what im looking for. 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.