How to run python or other scripts using PHP or other popular web programming languages in a Linux environment? Problem We want to access the PHP program through a web server application (Apache/Nginx). The PHP program needs to run other scripts stored in the same machine. Sample Problem PHP program is located in /var/www/html/index.php Python program is located in /var/www/html/capture.py Python program will access Pi Camera, capture an image, and store it in /var/www/html/assets/photo.jpg Solution index.php should access and run capture.py script. The script is as follows: $output = shell_exec("python /var/www/html/capture.py"); Execution of external program using shell_exec() or exec() will block the program. The next line of PHP codes will be run after the external program returns an output. So, we shouldn't run an excessive amount of external programs. Clients will wait too long on their browser. If our application actually needs ma