I have an embedded linux board with a LAMP server running. Everything works fine. So my problem is now to call a python script from a website. That's my python script:
#!/usr/bin/env python2
import cv2.cv as cv
print cv.__version__
print '<br>'
capture = cv.CaptureFromCAM(0)
print capture
print '<br>'
img = cv.QueryFrame(capture)
cv.SaveImage("/srv/http/BMWneu.jpg",img)
print 'Picture taken'
It is executable and runs fine in the commandline in arch linux. But if I start it from the web interface only party will be executed in the script. So only the print commands and the include is working.
My php file looks like this:
<?php
$result=shell_exec("python2 capture.py");
echo $result
?>
And the output in the browser is this:
2.4.12.2
Picture taken
So both opencv commands are being ignored. Can anybody help me?
Picture taken so everything works fine. @ Martijn Pieters: If i put your code in the php nothing happens anymore.