I want to execute my python script (/var/www/html/start.py) in my php script (/var/www/html/index.php) with the code below:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Test</title>
</head>
<body>
<h1>Test</h1>
<?php
shell_exec("python /var/www/html/start.py");
?>
</body>
</html>
The command works in the terminal and the python code is fine. I also tried to put the code in an external php script. No errors are shown.
#! /usr/bin/env python
import subprocess
subprocess.call(["/home/pi/pipresents/pipresents.py", "-p", "pp_mediashow"])
I am working with an raspberry pi and apache2 to show the index.php on web. I installed PHP 7.3.