So basically im trying to run my opencv python script (detects either Blue, yellow or green) with a php code in my raspi through localhost
however it doesnt seem to run whenever i press the button to run the said script, i tried running it through the shell itself and it runs fine
This is the code for running the opencv app
if(isset($_GET['project'])){
echo shell_exec("python3 cvtest.py");
}
and this is the python file (should return a string, which it does from shell but not when in the php file) [OpenCV app] (https://1drv.ms/u/s!ArBHaZP1appfo0cYjggXnUGVaeWf?e=owY29m)
Edit1: By the way the opencv is installed through pip-install opencv-python
Edit2: so i tried running the py app as www-data (which it does when run from localhost) and it says that "cant open camera by index 0" so how can i allow www-data to access the camera