I have a python script that displays info about USB ports, which can be used to turn ports on/off. I want to run it from PHP.
I tried the following code without any options specified (which just displays info) and it worked:
$output = exec('python /home/ratta/usb_control.py');
echo $output;
I then tried adding the necessary options but it doesn't turn the USB port off as it should:
$output = exec('python /home/ratta/usb_control.py --hub 001:011 --port 3 --power 0');
echo $output;
Any ideas anyone? The script runs fine when running it manually without PHP.
Thanks