1

I know if I want to run multiple Python scripts simultaneously I can knock up a bash file that looks like this;

#!/bin/bash
python pr1.py & 
python pr2.py &
python now.py &
python loader.py &

But what if I want to do the same thing directly from PHP? It seems clunky to call a bash script from PHP which then runs the Python scripts.

manners
  • 169
  • 1
  • 2
  • 10
  • 4
    Possible duplicate of [php execute a background process](http://stackoverflow.com/questions/45953/php-execute-a-background-process) – iFlo Feb 06 '17 at 14:31
  • 1
    http://stackoverflow.com/questions/11052162/run-bash-command-from-php & http://stackoverflow.com/questions/14155669/call-python-script-from-bash-with-argument – Ari Gold Feb 06 '17 at 14:33
  • Have you found an answer to that? – remyremy Jul 29 '20 at 10:37

1 Answers1

0

Well, as far as that goes, it seems clunky to call a Python script from PHP, but you could try the shell_exec() function or execution operator.

alanlittle
  • 460
  • 2
  • 12