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 Link to comment https://forums.phpfreaks.com/topic/95334-exec-function-help/ 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? Link to comment https://forums.phpfreaks.com/topic/95334-exec-function-help/#findComment-488295 Share on other sites More sharing options...
l0ve2hat3 Posted March 10, 2008 Author Share Posted March 10, 2008 blank Link to comment https://forums.phpfreaks.com/topic/95334-exec-function-help/#findComment-488302 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 Link to comment https://forums.phpfreaks.com/topic/95334-exec-function-help/#findComment-488312 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. Link to comment https://forums.phpfreaks.com/topic/95334-exec-function-help/#findComment-488348 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? Link to comment https://forums.phpfreaks.com/topic/95334-exec-function-help/#findComment-488668 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? Link to comment https://forums.phpfreaks.com/topic/95334-exec-function-help/#findComment-488670 Share on other sites More sharing options...
l0ve2hat3 Posted March 11, 2008 Author Share Posted March 11, 2008 can anybody help me? Link to comment https://forums.phpfreaks.com/topic/95334-exec-function-help/#findComment-489091 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 Link to comment https://forums.phpfreaks.com/topic/95334-exec-function-help/#findComment-489095 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. Link to comment https://forums.phpfreaks.com/topic/95334-exec-function-help/#findComment-489107 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.