Here I get a querystring depending upon the value from the command shell_exec()
.
I am receiving a value the querystring but shell_exec()
is not working.
I am using a webcam connected to Raspberry pi 3 so the command in shell_exec()
is to turn the webcam ON an OFF.
$output=shell_exec('sudo /etc/init.d/motion start')
code:
<?php
$status=$_GET['status'];
if($status == 'on')
{
$output=shell_exec('sudo /etc/init.d/motion start');
}
if($status == 'off')
{
$output=shell_exec('sudo /etc/init.d/motion start');
}
How do I solve the execution issue?
start
command to/etc/init.d/motion
. I guess the first one should sendstop
. Also, can you give us your error ? We can't help you if we don't know what the crash is. – Carpette Apr 04 '18 at 13:10