I am a newbie to Raspberry pi

Digital Camera - view webcam (not pi camera) and capture image on button click inside a browser - in php

I am trying to write a browser based image capture software with php which uses a webcam to stream video inside a browser and on click of a button (say CLICK) it should capture an image on to the disk.

Tried using motion start and stop and then fswebcam to capture and resume motion.

However, motion does not work inside a browser

sudo motion sudo service motion start

when the same is tried inside a python script, it works. However, calling the python inside a php code and running inside browser does not work.

Interstingly, when php is typed from terminal, it works.

THanks in advance for the help.

  • Sounds like the interfaces are getting confused. Here are some things to verify: Be sure the first line of the python script includes the shebang (pound)!/usr/local/bin/python Make sure your python script is in a directory accessible by the vhost. Make sure the script is set to be executable chmod +x script.py Also, make sure your PHP is not running in safe mode. Then you should be able to call it with $exec as long as the entire path to the script is used as the command. – SDsolar Sep 18 '16 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.