Go to advanced search

by Santosh42
Wed May 24, 2017 6:44 am
Forum: Python
Topic: Problem when trying to run python scripts from apache php
Replies: 4
Views: 1469

Re: Problem when trying to run python scripts from apache ph

To my sudoers file I added

Code: Select all

www-data ALL=/home/pi/Santosh/pyphp/on.py NOPASSSWD
www-data ALL=/home/pi/Santosh/pyphp/off.py NOPASSWD
It wasn't working. Then I added

Code: Select all

www-data ALL=(ALL) NOPASSWD: ALL
Now its working.
Is this the best approach?
by Santosh42
Mon May 22, 2017 10:46 am
Forum: Python
Topic: Problem when trying to run python scripts from apache php
Replies: 4
Views: 1469

Problem when trying to run python scripts from apache php

Hey guys, when I use the command sudo python3 /home/pi/Santosh/pyphp/on.py from the rpi terminal it works fine... but the following code isn't able to execute the same command... <?php exec("sudo python3 /home/pi/Santosh/pyphp/off.py"); ?> I am running apache server on my rpi with this php code. on....
by Santosh42
Thu May 18, 2017 10:17 am
Forum: Troubleshooting
Topic: Error when trying to capture video from usb camera
Replies: 1
Views: 560

Re: Error when trying to capture video from usb camera

supra wrote:Here is tutorial link for newbie:
http://opencv-python-tutroals.readthedo ... splay.html
I understand what the commands do. It's the error I am not able to resolve. I think it has to do with some rpi packages missing... any idea?
by Santosh42
Thu May 18, 2017 6:02 am
Forum: Troubleshooting
Topic: Error when trying to capture video from usb camera
Replies: 1
Views: 560

Error when trying to capture video from usb camera

Hello guys, I am getting this error when trying to execute this code. I am new to RPi, so please go easy on me. :)

Code:

Code: Select all

import cv2
cap = cv2.VideoCapture(0)
#_,frame = cap.read()
#cv2.imshow("test",frame);
Error:
VIDEOIO ERROR: V4L/V4L2: VIDIOC_S_CROP

Go to advanced search