i´m very frustated because i have an issue and no idea why it dosn´t works!
Explain:
I have an RPI with Apache Webserver (incl. PHP). There is a php-Site who starting an bash-script inside the /var/www/html/scripts-Folder.
The script .sh starts a python-Script located /home/pi/Desktop/myscript.py. Everything works absolute great and doing that what it have to do very good.
But if i try to expand more function by addition more scripts it dosn´t works!
This is the Example of my Python-Script who is already working from PHP:
start.py
Code: Select all
#!/usr/local/bin/python
from time import sleep
from datetime import datetime
from sh import gphoto2 as gp
import signal, os, subprocess
..........
start.sh
Code: Select all
#!/bin/bash
#DISPLAY=:0 chromium-browser --kiosk http://127.0.0.1/Animation_Startseite.html
sudo python3 /home/pi/Desktop/start.py
start.php
Code: Select all
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="refresh" content="1; url=working2.php">
<script type='text/javascript' src='Animation_verarbeitung_resources/jquery-3.3.1.min.js'></script>
</head>
<body style="background-color:black;">>
<body>
<div id="Animation_verarbeitungStage" class="wascript">
<script type="text/javascript" charset="utf-8" src="Animation_verarbeitung_resources/WA_SCRIPT.js"></script>
</div>
<body>
<center><img src="http://192.168.178.5:8000/stream.mjpg" width="800" height="600"></center>
</body>
<?php
$script = "sudo /var/www/html/scripts/start.sh";
$run=`$script`;
?>
</body>
</html>
Code: Select all
www-data ALL= NOPASSWD:/var/www/html/scripts/start.sh
BUT NOW:
I try to make a copy of them what i already posted above. Maybe everything named with a "2" at the end start2.py, start2.php for Example.
I did everything exactly like before but it doesnt works.
OK, the first sequence i programmed in January and today i like to expand some functions. I can´t say that i didnt do a little step more then today, but i dont know where is the problem!
And before some of you starts screaming "IT SECURITY" and "THATS A NOGO": The System ist Embedded and not reachable from Outside.
I feel very happy if someone can help me. I hope i can convey my problem, because my english is not the best.