0

I am trying to run a local host server using laragon .I want to start a python program and keep it running(even after server restart) until my server shutdowns . Suppose i have a file test.py , I want to keep it running as soon as my server starts up .

I know it might work when used with PHP and calling that script using the browser. But i want to run it as soon as the server starts up as a python program.

  • Could be understanding this wrong, but I'd imagine the best way to do this might just be to write a bash script. Fire off your python script at the same time you bootup your server, keep it pinging the server at localhost and if there's no ping (the server has shut down) kill that same python script. – Alex Mapley Oct 13 '19 at 16:14
  • I am running it as a local host server in a windows environment . I was looking for some way to edit the configuration of Apache so that my script run along with the Apache during its startup. – Jyothish Athi Oct 14 '19 at 18:07
  • https://stackoverflow.com/questions/14718865/run-php-script-in-background-on-apache-start-restartwindows-server might be a good read, best of luck bud seems like it's a lot harder in windows – Alex Mapley Oct 15 '19 at 14:32

0 Answers0