techker Posted May 4, 2017 Share Posted May 4, 2017 Hey guy's i doing a Rasperry Pi garage door app and got this code in a tutorial: $q=$_GET["q"]; if(isset($_GET['q']) && $_GET['q'] == 1) { error_reporting(E_ALL); exec('gpio write 7 0'); usleep(1000000); exec('gpio write 7 1'); echo" garage is Open"; } i modified it to return a response. but i get an error file from server PHP Warning: exec() has been disabled for security reasons in /home/techker/public_html/Garage/getcd.php on line 15 is there an alternative or way around this ? Quote Link to comment https://forums.phpfreaks.com/topic/303863-php-warning-exec-has-been-disabled-alternative/ Share on other sites More sharing options...
Jacques1 Posted May 4, 2017 Share Posted May 4, 2017 And what exactly prevents you from enabling the function? Adjust the disable_functions parameter in your php.ini. Quote Link to comment https://forums.phpfreaks.com/topic/303863-php-warning-exec-has-been-disabled-alternative/#findComment-1546182 Share on other sites More sharing options...
techker Posted May 4, 2017 Author Share Posted May 4, 2017 i don't think i have access...i will check the cpanel to see Quote Link to comment https://forums.phpfreaks.com/topic/303863-php-warning-exec-has-been-disabled-alternative/#findComment-1546187 Share on other sites More sharing options...
Jacques1 Posted May 4, 2017 Share Posted May 4, 2017 i don't think i have access... Then you may be out of luck. The PHP manual gives you a collection of functions which can be used as an alternative to system(), but it's hard to imagine that they've disabled system() while keeping equivalent functions enabled. This wouldn't make any sense. Quote Link to comment https://forums.phpfreaks.com/topic/303863-php-warning-exec-has-been-disabled-alternative/#findComment-1546188 Share on other sites More sharing options...
techker Posted May 4, 2017 Author Share Posted May 4, 2017 i sent out a request .. in the cpanel i only have basic php ini values that i can mod.... Quote Link to comment https://forums.phpfreaks.com/topic/303863-php-warning-exec-has-been-disabled-alternative/#findComment-1546189 Share on other sites More sharing options...
requinix Posted May 4, 2017 Share Posted May 4, 2017 ...Shouldn't this code be running on the Pi? Your Pi? That I assume you have full control over? 1 Quote Link to comment https://forums.phpfreaks.com/topic/303863-php-warning-exec-has-been-disabled-alternative/#findComment-1546204 Share on other sites More sharing options...
techker Posted May 5, 2017 Author Share Posted May 5, 2017 ya i found a way to install apache server in it and access it remotly.but the gpio is not activating..will figure that part..thx! Quote Link to comment https://forums.phpfreaks.com/topic/303863-php-warning-exec-has-been-disabled-alternative/#findComment-1546250 Share on other sites More sharing options...
requinix Posted May 6, 2017 Share Posted May 6, 2017 Apache is a bit of a hog. Consider nginx instead. Quote Link to comment https://forums.phpfreaks.com/topic/303863-php-warning-exec-has-been-disabled-alternative/#findComment-1546259 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.