I have been attempting to use RaspiStill in PHP for a number of days now. I have searched around and have been unable to come up with a solution.
I have been attempting to use shell_exec()
in my php file like so:
shell_exec("/usr/bin/raspistill -rot 180 -q 70 -w 1920 -h 1080 -o /media/64GB/www/timelapse/image_image.jpg 2>&1")
Which works if you use it from the console and type:
php php_script.php
At first I was getting this error when running the php script in the browser:
sudo: no tty present and no askpass program specified
This was resolved by updating /etc/sudoers
with:
Defaults:www-data !requiretty
I also added this line:
www-data ALL=(ALL) NOPASSWD: ALL
No error is returned in the apache logs so I am not sure what else to try.
sudo
, so I don't see how the sudo error you received is related to that command. – HeatfanJohn Oct 13 '13 at 13:31