How to start Motion through php?
I have tried the following two php commands but still cannot start the Motion though php. The motion can be started by typing the command line "motion" directly at the terminal.
I also tested the command with "exec('ls -l'); and it works. Moreover, Motion can be quited by using the URL control.
Could we start the Motion though the php or Motion can only be start at the terminal directly?
I have found out the problem. It is because the user "www-data" cannot access the /dev/video0 device. After I change the owership, it can be start though the Internet.
| Motion version:
| ffmpeg version:
|| ffmpeg, mysql, postgresql
| Server OS:
- 04 Apr 2008
First , you should try to upgrade your motion to latest version 3.2.9 or even 3.2.10 ( release candidate ).
Motion has a built-in http control not related at all with apache , so you are stoping motion using this built-in http control.
You can use php , python , perl or whatever from apache to start / stop motion , but i think that best way is start motion with init.d script
and restart using http control.
Anyway if you want to control motion from apache using any embedded application be sure that motion has same permission of apache to access
to filesystem ( pid file , directory to save images & videos , etc ) and video dev.
- 05 Apr 2008